From 604ace9cfc9fae6b6c121259523a9060c5306161 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Mon, 27 Feb 2012 11:59:58 -0800 Subject: - 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 --- js/document/html-document.js | 4 ++++ js/mediators/keyboard-mediator.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'js') 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, { if(typeof this.application.ninja.selectedElements !== 'undefined'){ this.selectionModel = this.application.ninja.selectedElements; } + + this.draw3DGrid = this.application.ninja.appModel.show3dGrid; } }, @@ -644,6 +646,8 @@ exports.HTMLDocument = Montage.create(TextDocument, { this.application.ninja.stage._scrollLeft = this.savedTopScroll; } this.application.ninja.stage.handleScroll(); + + this.application.ninja.appModel.show3dGrid = this.draw3DGrid; } } //////////////////////////////////////////////////////////////////// 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, { } // Zoom tool - if(evt.keyCode === Keyboard.Z ) { + if((evt.keyCode === Keyboard.Z) && !(evt.ctrlKey || evt.metaKey) && !evt.shiftKey) {//ctrl or shift key not press with Z evt.preventDefault(); this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[14]}); return; -- cgit v1.2.3