X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/f8c046d1828d9d54fd4feff67bc2f277baf03985..ab7f5def04a667ce4e6a6aff8b51d27b82550f42:/resources/assets/js/directives.js diff --git a/resources/assets/js/directives.js b/resources/assets/js/directives.js index 7436a75a0..08b82357f 100644 --- a/resources/assets/js/directives.js +++ b/resources/assets/js/directives.js @@ -20,7 +20,7 @@ module.exports = function (ngApp, events) { link: function (scope, element, attrs) { function tinyMceSetup(editor) { - editor.on('ExecCommand change NodeChange ObjectResized', (e) => { + editor.on('ExecCommand change input NodeChange ObjectResized', (e) => { let content = editor.getContent(); $timeout(() => { scope.mceModel = content; @@ -29,7 +29,10 @@ module.exports = function (ngApp, events) { }); editor.on('keydown', (event) => { - scope.$emit('editor-keydown', event); + if (event.keyCode === 83 && (navigator.platform.match("Mac") ? event.metaKey : event.ctrlKey)) { + event.preventDefault(); + scope.$emit('save-draft', event); + } }); editor.on('init', (e) => {