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