mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-05-25 00:00:00 +08:00
Added (Ctrl+s) draft force save
This commit is contained in:
@ -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.
|
||||
|
Reference in New Issue
Block a user