From 88a3f4c51c0613510ef2f63a1c47ec323b5f7524 Mon Sep 17 00:00:00 2001 From: Jeremy Zhang Date: Thu, 14 Sep 2017 05:30:16 +0000 Subject: [PATCH] Cmd/Ctrl S Saves and submits custom css if the cursor is inside the editor --- webapp/titanembeds/static/js/usercss.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/webapp/titanembeds/static/js/usercss.js b/webapp/titanembeds/static/js/usercss.js index 31d7f47..489ae7a 100644 --- a/webapp/titanembeds/static/js/usercss.js +++ b/webapp/titanembeds/static/js/usercss.js @@ -2,7 +2,13 @@ (function () { if($("#css_editor").length != 0) { 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() {