diff options
author | Jose Antonio Marquez | 2012-02-28 13:33:31 -0800 |
---|---|---|
committer | Jose Antonio Marquez | 2012-02-28 13:33:31 -0800 |
commit | 3a25881b3a463e4f695be2f663f141710ba1d1c1 (patch) | |
tree | 657d55ad394de168dd627cf89b875906d10584e2 /js/mediators/keyboard-mediator.js | |
parent | d764428023d87446fbbb153d8e04a23b900d71d5 (diff) | |
parent | 7c9291a5bab4abd849547f8878f6fb962fc88250 (diff) | |
download | ninja-3a25881b3a463e4f695be2f663f141710ba1d1c1.tar.gz |
Merge branch 'refs/heads/NinjaInternal' into Color
Diffstat (limited to 'js/mediators/keyboard-mediator.js')
-rwxr-xr-x | js/mediators/keyboard-mediator.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/js/mediators/keyboard-mediator.js b/js/mediators/keyboard-mediator.js index 0282060f..443a18ac 100755 --- a/js/mediators/keyboard-mediator.js +++ b/js/mediators/keyboard-mediator.js | |||
@@ -162,15 +162,17 @@ exports.KeyboardMediator = Montage.create(Component, { | |||
162 | return; | 162 | return; |
163 | } | 163 | } |
164 | 164 | ||
165 | // Hand tool | ||
165 | if(evt.keyCode === Keyboard.H ) { | 166 | if(evt.keyCode === Keyboard.H ) { |
166 | evt.preventDefault(); | 167 | evt.preventDefault(); |
167 | this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[15]}); | 168 | this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[14]}); |
168 | return; | 169 | return; |
169 | } | 170 | } |
170 | 171 | ||
172 | // Zoom tool | ||
171 | if(evt.keyCode === Keyboard.Z ) { | 173 | if(evt.keyCode === Keyboard.Z ) { |
172 | evt.preventDefault(); | 174 | evt.preventDefault(); |
173 | this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[16]}); | 175 | this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[15]}); |
174 | return; | 176 | return; |
175 | } | 177 | } |
176 | 178 | ||
@@ -205,7 +207,13 @@ exports.KeyboardMediator = Montage.create(Component, { | |||
205 | 207 | ||
206 | // Check if cmd+s/ctrl+s for Save (Windows/Mac) | 208 | // Check if cmd+s/ctrl+s for Save (Windows/Mac) |
207 | if ((evt.keyCode == Keyboard.S) && (evt.ctrlKey || evt.metaKey) && !evt.shiftKey) { | 209 | if ((evt.keyCode == Keyboard.S) && (evt.ctrlKey || evt.metaKey) && !evt.shiftKey) { |
208 | NJevent("executeSave"); | 210 | try{ |
211 | NJevent("executeSave"); | ||
212 | } | ||
213 | catch(e){ | ||
214 | console.warn("Unable to save"); | ||
215 | console.log(e.stack); | ||
216 | } | ||
209 | evt.preventDefault(); | 217 | evt.preventDefault(); |
210 | return; | 218 | return; |
211 | } | 219 | } |