diff options
Diffstat (limited to 'js/mediators/keyboard-mediator.js')
-rwxr-xr-x | js/mediators/keyboard-mediator.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/js/mediators/keyboard-mediator.js b/js/mediators/keyboard-mediator.js index e8a11ad8..40b26582 100755 --- a/js/mediators/keyboard-mediator.js +++ b/js/mediators/keyboard-mediator.js | |||
@@ -85,7 +85,8 @@ exports.KeyboardMediator = Montage.create(Component, { | |||
85 | 85 | ||
86 | handleKeydown: { | 86 | handleKeydown: { |
87 | value: function(evt) { | 87 | value: function(evt) { |
88 | if(document.activeElement.nodeName !== "BODY") { | 88 | if((document.activeElement.nodeName !== "BODY") && (!!this.application.ninja.documentController.activeDocument) |
89 | && (this.application.ninja.documentController.activeDocument.currentView === "design")) { | ||
89 | // Don't do anything if an input or other control is focused | 90 | // Don't do anything if an input or other control is focused |
90 | return; | 91 | return; |
91 | } | 92 | } |
@@ -110,6 +111,13 @@ exports.KeyboardMediator = Montage.create(Component, { | |||
110 | return; | 111 | return; |
111 | } | 112 | } |
112 | 113 | ||
114 | // Check if cmd+s/ctrl+s for Save (Windows/Mac) | ||
115 | if ((evt.keyCode == Keyboard.S) && (evt.ctrlKey || evt.metaKey) && !evt.shiftKey) { | ||
116 | NJevent("executeSave"); | ||
117 | evt.preventDefault(); | ||
118 | return; | ||
119 | } | ||
120 | |||
113 | // Check if cmd+shift+z for Redo (Mac) | 121 | // Check if cmd+shift+z for Redo (Mac) |
114 | if ((evt.keyCode == Keyboard.Z) && evt.metaKey && evt.shiftKey) { | 122 | if ((evt.keyCode == Keyboard.Z) && evt.metaKey && evt.shiftKey) { |
115 | NJevent("executeRedo"); | 123 | NJevent("executeRedo"); |