Added (Ctrl+s) draft force save

This commit is contained in:
Dan Brown
2016-05-28 13:51:07 +01:00
parent f602b088ac
commit 5b9362ab0b
2 changed files with 18 additions and 1 deletions

View File

@ -379,6 +379,15 @@ module.exports = function (ngApp, events) {
saveDraft();
};
// Listen to shortcuts coming via events
$scope.$on('editor-keydown', (event, data) => {
// Save shortcut (ctrl+s)
if (data.keyCode == 83 && (navigator.platform.match("Mac") ? data.metaKey : data.ctrlKey)) {
data.preventDefault();
saveDraft();
}
});
/**
* Discard the current draft and grab the current page
* content from the system via an AJAX request.