pull/86/head
Darks 2 years ago
parent e265e003b9
commit 67c3ebba42
Signed by: Darks
GPG Key ID: 7515644268BE1433
  1. 19
      app/templates/widgets/editor.html

@ -37,8 +37,27 @@
shortcuts: {
toggleFullScreen: null,
},
status: false,
});
// Ctrl+Enter submits form
ta = document.querySelector("div.CodeMirror");
ta.addEventListener('keydown', function(e) {
var keyCode = e.keyCode || e.which;
if (e.ctrlKey && keyCode == 13) {
var e = e.target;
while(! (e instanceof HTMLFormElement)) {
e = e.parentNode;
}
try {
e.submit();
} catch(exception) {
e.submit.click();
}
}
});
});
</script>
{% for error in field.errors %}
<span class="msgerror">{{ error }}</span>

Loading…
Cancel
Save