aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAnanya Sen2012-02-27 11:59:58 -0800
committerAnanya Sen2012-02-27 11:59:58 -0800
commit604ace9cfc9fae6b6c121259523a9060c5306161 (patch)
treefb9058a1d828222b47ab4e71523667171b868a6d /js
parentb056b4bef5982466d80d72e5cbb31e63087990e1 (diff)
downloadninja-604ace9cfc9fae6b6c121259523a9060c5306161.tar.gz
- save show3DGrid flag per document while switching documents
- fix zoom tool keyboard control to listen to Z when ctrl and shift keys are not pressed with it Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js')
-rwxr-xr-xjs/document/html-document.js4
-rwxr-xr-xjs/mediators/keyboard-mediator.js2
2 files changed, 5 insertions, 1 deletions
diff --git a/js/document/html-document.js b/js/document/html-document.js
index 8798b407..c36e61d5 100755
--- a/js/document/html-document.js
+++ b/js/document/html-document.js
@@ -623,6 +623,8 @@ exports.HTMLDocument = Montage.create(TextDocument, {
623 if(typeof this.application.ninja.selectedElements !== 'undefined'){ 623 if(typeof this.application.ninja.selectedElements !== 'undefined'){
624 this.selectionModel = this.application.ninja.selectedElements; 624 this.selectionModel = this.application.ninja.selectedElements;
625 } 625 }
626
627 this.draw3DGrid = this.application.ninja.appModel.show3dGrid;
626 } 628 }
627 }, 629 },
628 630
@@ -644,6 +646,8 @@ exports.HTMLDocument = Montage.create(TextDocument, {
644 this.application.ninja.stage._scrollLeft = this.savedTopScroll; 646 this.application.ninja.stage._scrollLeft = this.savedTopScroll;
645 } 647 }
646 this.application.ninja.stage.handleScroll(); 648 this.application.ninja.stage.handleScroll();
649
650 this.application.ninja.appModel.show3dGrid = this.draw3DGrid;
647 } 651 }
648 } 652 }
649 //////////////////////////////////////////////////////////////////// 653 ////////////////////////////////////////////////////////////////////
diff --git a/js/mediators/keyboard-mediator.js b/js/mediators/keyboard-mediator.js
index f05d3382..e5b50b03 100755
--- a/js/mediators/keyboard-mediator.js
+++ b/js/mediators/keyboard-mediator.js
@@ -170,7 +170,7 @@ exports.KeyboardMediator = Montage.create(Component, {
170 } 170 }
171 171
172 // Zoom tool 172 // Zoom tool
173 if(evt.keyCode === Keyboard.Z ) { 173 if((evt.keyCode === Keyboard.Z) && !(evt.ctrlKey || evt.metaKey) && !evt.shiftKey) {//ctrl or shift key not press with Z
174 evt.preventDefault(); 174 evt.preventDefault();
175 this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[14]}); 175 this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[14]});
176 return; 176 return;