symposion_app/pinaxcon/widgets.py
Sachi King 39b556b7ac Mass style-check update
Seems okay.
2017-03-31 11:54:46 +11:00

17 lines
472 B
Python

from django import forms
class AceMarkdownEditor(forms.Textarea):
def render(self, name, value, attrs):
original = super(AceMarkdownEditor, self).render(name, value, attrs)
ret = '''
%s
<script>
window.addEventListener("load", () => {
editor = loadEditor("%s");
}, 0);
</script>
''' % (original, attrs["id"])
return ret