Fixed quick save shortcut in wysiwyg editor

Fixes #467
This commit is contained in:
Dan Brown 2017-09-10 13:01:48 +01:00
parent f8c046d182
commit fec6c65b78
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
2 changed files with 5 additions and 3 deletions

View File

@ -20,7 +20,7 @@ module.exports = function (ngApp, events) {
link: function (scope, element, attrs) { link: function (scope, element, attrs) {
function tinyMceSetup(editor) { function tinyMceSetup(editor) {
editor.on('ExecCommand change NodeChange ObjectResized', (e) => { editor.on('ExecCommand change input NodeChange ObjectResized', (e) => {
let content = editor.getContent(); let content = editor.getContent();
$timeout(() => { $timeout(() => {
scope.mceModel = content; scope.mceModel = content;
@ -29,7 +29,10 @@ module.exports = function (ngApp, events) {
}); });
editor.on('keydown', (event) => { 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) => { editor.on('init', (e) => {

View File

@ -9,7 +9,6 @@
@import "header"; @import "header";
@import "lists"; @import "lists";
@import "pages"; @import "pages";
@import "comments";
table { table {
border-spacing: 0; border-spacing: 0;