From fec6c65b78a490e45bb4e23c4014c592339b0911 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Sun, 10 Sep 2017 13:01:48 +0100 Subject: [PATCH] Fixed quick save shortcut in wysiwyg editor Fixes #467 --- resources/assets/js/directives.js | 7 +++++-- resources/assets/sass/export-styles.scss | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) 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) => { diff --git a/resources/assets/sass/export-styles.scss b/resources/assets/sass/export-styles.scss index 19579004b..1f7caf1d9 100644 --- a/resources/assets/sass/export-styles.scss +++ b/resources/assets/sass/export-styles.scss @@ -9,7 +9,6 @@ @import "header"; @import "lists"; @import "pages"; -@import "comments"; table { border-spacing: 0;