Migrated markdown editor actions to new cm editor

This commit is contained in:
Dan Brown
2017-07-02 19:35:13 +01:00
parent f101e4f010
commit 69c50b9b48
4 changed files with 119 additions and 153 deletions

View File

@ -370,14 +370,8 @@ 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();
}
});
// Listen to save draft events from editor
$scope.$on('save-draft', saveDraft);
/**
* Discard the current draft and grab the current page