From fd264c58bfc5f53f57d9ddfd06114124b14bac04 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 1 Jun 2012 14:54:19 -0700 Subject: Moving styles controller higher in ninja's serialization so its bindings will get triggered before stage's bindings. This should fix the stage's styles not getting initialized correctly. Signed-off-by: Nivesh Rajbhandari --- js/controllers/styles-controller.js | 4 ---- js/ninja.reel/ninja.html | 14 +++++++------- js/stage/stage.reel/stage.js | 4 +--- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/js/controllers/styles-controller.js b/js/controllers/styles-controller.js index 14857bf9..f35a6757 100755 --- a/js/controllers/styles-controller.js +++ b/js/controllers/styles-controller.js @@ -179,10 +179,6 @@ var stylesController = exports.StylesController = Montage.create(Component, { this.setStyles(rule, styles); this.addClass(this.currentDocument.model.documentRoot, "ninja-body"); } - - //TODO - Temporarily moving this here so we guarantee the StylesController has a chance - // to initialize the stage's styles prior to doing any styles lookup. - this.application.ninja.stage.snapManager.setupDragPlaneFromPlane (workingPlane); } }, /* ----------------- Rule methods ----------------- */ diff --git a/js/ninja.reel/ninja.html b/js/ninja.reel/ninja.html index 0c0944e7..33c3080f 100755 --- a/js/ninja.reel/ninja.html +++ b/js/ninja.reel/ninja.html @@ -150,6 +150,13 @@ ] }, + "stylesController": { + "prototype": "js/controllers/styles-controller", + "bindings": { + "currentDocument": {"<-": "@documentList.selectedObjects.0"} + } + }, + "stageMode": { "prototype": "js/components/layout/stage-mode.reel", "properties": { @@ -318,13 +325,6 @@ "prototype": "js/controllers/color-controller" }, - "stylesController": { - "prototype": "js/controllers/styles-controller", - "bindings": { - "currentDocument": {"<-": "@documentList.selectedObjects.0"} - } - }, - "presetsController": { "prototype": "js/controllers/presets-controller" }, diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js index 4d9296a1..d8f7313b 100755 --- a/js/stage/stage.reel/stage.js +++ b/js/stage/stage.reel/stage.js @@ -1090,9 +1090,7 @@ exports.Stage = Montage.create(Component, { this.snapManager._isCacheInvalid = true; this.snapManager.currentStage = this.currentDocument.model.documentRoot; - //TODO - StylesController needs to initialize the stage's styles prior to calling this. - // So, moving this into styles-controller.initializeRootStyles code. -// this.snapManager.setupDragPlaneFromPlane (workingPlane); + this.snapManager.setupDragPlaneFromPlane (workingPlane); this.drawUtils.initializeFromDocument(); } -- cgit v1.2.3 From 4dde49e0376e2cb64140f5baa85f5cadae0c9e16 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 1 Jun 2012 14:59:04 -0700 Subject: IKNinja-1609 - Stage rotates too fast when closing and re-opening file or switching between files. Signed-off-by: Nivesh Rajbhandari --- js/tools/RotateStage3DTool.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/js/tools/RotateStage3DTool.js b/js/tools/RotateStage3DTool.js index 12b21a64..9e117837 100755 --- a/js/tools/RotateStage3DTool.js +++ b/js/tools/RotateStage3DTool.js @@ -85,6 +85,12 @@ exports.RotateStage3DTool = Montage.create(Rotate3DToolBase, { } }, + captureSelectionChange: { + value: function(event){ + this.eventManager.addEventListener("selectionDrawn", this, true); + } + }, + captureSelectionDrawn: { value: function(event){ this._origin = null; @@ -114,6 +120,11 @@ exports.RotateStage3DTool = Montage.create(Rotate3DToolBase, { this._origin = viewUtils.localToGlobal(eltCtr, stage); this._setTransformOrigin(false); this.DrawHandles(); + + if(event) + { + this.eventManager.removeEventListener("selectionDrawn", this, true); + } } }, -- cgit v1.2.3