diff options
author | 2018-06-20 14:07:14 +0100 | |
---|---|---|
committer | 2018-06-20 14:07:14 +0100 | |
commit | 95e9754858505ef35cff6ab0f78eceb3c074222c (patch) | |
tree | 144842183984bdc5cc28545596b8c93ddb3f6657 /templates/staff/tables/edit.html | |
parent | Merge branch 'momo/fix-jam-question-add' into 'master' (diff) |
Fix RST editor loading on pages that use it
Diffstat (limited to 'templates/staff/tables/edit.html')
-rw-r--r-- | templates/staff/tables/edit.html | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/templates/staff/tables/edit.html b/templates/staff/tables/edit.html index 421f6c45..b3b9faae 100644 --- a/templates/staff/tables/edit.html +++ b/templates/staff/tables/edit.html @@ -32,17 +32,19 @@ <script type="application/javascript"> "use strict"; - let editor = ace.edit("editor"); + window.onload = () => { + let editor = ace.edit("editor"); - editor.session.setMode("ace/mode/json"); - editor.session.setUseWrapMode(true); + editor.session.setMode("ace/mode/json"); + editor.session.setUseWrapMode(true); - editor.setTheme("ace/theme/iplastic"); - editor.setShowPrintMargin(false); + editor.setTheme("ace/theme/iplastic"); + editor.setShowPrintMargin(false); - editor.on("input", function() { - document.getElementById("json").value = editor.getValue(); - }); + editor.on("input", function () { + document.getElementById("json").value = editor.getValue(); + }); + }; </script> </div> {% endblock %} |