unbind all keyboard shortcuts from the underlaying editor so only keyboard shortcuts from the open editor works

This commit is contained in:
Mads Rasmussen
2018-12-18 13:40:37 +01:00
parent 9eecf9898e
commit 88d328a4e9

View File

@@ -125,7 +125,7 @@
so we need to store the shortcuts for the current editor so they can be rebound
when the infinite editor closes
*/
storeKeyboardShortcuts();
unbindKeyboardShortcuts();
// set flag so we know when the editor is open in "infinie mode"
editor.infiniteMode = true;
@@ -676,9 +676,15 @@
* to each editor so they can be rebound when an editor closes
*
*/
function storeKeyboardShortcuts() {
function unbindKeyboardShortcuts() {
const shortcuts = angular.copy(keyboardService.keyboardEvent);
editorsKeyboardShorcuts.push(shortcuts);
// unbind the current shortcuts because we only want to
// shortcuts from the newly opened editor working
for (let [key, value] of Object.entries(shortcuts)) {
keyboardService.unbind(key);
}
}
/**