aboutsummaryrefslogtreecommitdiffstats
path: root/templates/staff/tables/edit.html
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2018-06-20 14:07:14 +0100
committerGravatar Gareth Coles <[email protected]>2018-06-20 14:07:14 +0100
commit95e9754858505ef35cff6ab0f78eceb3c074222c (patch)
tree144842183984bdc5cc28545596b8c93ddb3f6657 /templates/staff/tables/edit.html
parentMerge 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.html18
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 %}