Cmd/Ctrl S Saves and submits custom css if the cursor is inside the editor

This commit is contained in:
Jeremy Zhang 2017-09-14 05:30:16 +00:00
parent fff737cec3
commit 88a3f4c51c

View File

@ -2,7 +2,13 @@
(function () { (function () {
if($("#css_editor").length != 0) { if($("#css_editor").length != 0) {
var editor = ace.edit("css_editor"); var editor = ace.edit("css_editor");
debugger; editor.commands.addCommand({
name: 'save',
bindKey: {win: "Ctrl-S", "mac": "Cmd-S"},
exec: function(editor) {
$('#submit-btn').trigger('click');
}
});
} }
function postForm() { function postForm() {