aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-06-01 14:54:19 -0700
committerNivesh Rajbhandari2012-06-01 14:54:19 -0700
commitfd264c58bfc5f53f57d9ddfd06114124b14bac04 (patch)
tree41ac230e008fc53ae6a2590258aa5daa4224dca1 /js
parent69ca67093bb53188dca5437e0bfbfb7f676ada85 (diff)
downloadninja-fd264c58bfc5f53f57d9ddfd06114124b14bac04.tar.gz
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 <mqg734@motorola.com>
Diffstat (limited to 'js')
-rwxr-xr-xjs/controllers/styles-controller.js4
-rwxr-xr-xjs/ninja.reel/ninja.html14
-rwxr-xr-xjs/stage/stage.reel/stage.js4
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, {
179 this.setStyles(rule, styles); 179 this.setStyles(rule, styles);
180 this.addClass(this.currentDocument.model.documentRoot, "ninja-body"); 180 this.addClass(this.currentDocument.model.documentRoot, "ninja-body");
181 } 181 }
182
183 //TODO - Temporarily moving this here so we guarantee the StylesController has a chance
184 // to initialize the stage's styles prior to doing any styles lookup.
185 this.application.ninja.stage.snapManager.setupDragPlaneFromPlane (workingPlane);
186 } 182 }
187 }, 183 },
188 /* ----------------- Rule methods ----------------- */ 184 /* ----------------- 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 @@
150 ] 150 ]
151 }, 151 },
152 152
153 "stylesController": {
154 "prototype": "js/controllers/styles-controller",
155 "bindings": {
156 "currentDocument": {"<-": "@documentList.selectedObjects.0"}
157 }
158 },
159
153 "stageMode": { 160 "stageMode": {
154 "prototype": "js/components/layout/stage-mode.reel", 161 "prototype": "js/components/layout/stage-mode.reel",
155 "properties": { 162 "properties": {
@@ -318,13 +325,6 @@
318 "prototype": "js/controllers/color-controller" 325 "prototype": "js/controllers/color-controller"
319 }, 326 },
320 327
321 "stylesController": {
322 "prototype": "js/controllers/styles-controller",
323 "bindings": {
324 "currentDocument": {"<-": "@documentList.selectedObjects.0"}
325 }
326 },
327
328 "presetsController": { 328 "presetsController": {
329 "prototype": "js/controllers/presets-controller" 329 "prototype": "js/controllers/presets-controller"
330 }, 330 },
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, {
1090 1090
1091 this.snapManager._isCacheInvalid = true; 1091 this.snapManager._isCacheInvalid = true;
1092 this.snapManager.currentStage = this.currentDocument.model.documentRoot; 1092 this.snapManager.currentStage = this.currentDocument.model.documentRoot;
1093 //TODO - StylesController needs to initialize the stage's styles prior to calling this. 1093 this.snapManager.setupDragPlaneFromPlane (workingPlane);
1094 // So, moving this into styles-controller.initializeRootStyles code.
1095// this.snapManager.setupDragPlaneFromPlane (workingPlane);
1096 1094
1097 this.drawUtils.initializeFromDocument(); 1095 this.drawUtils.initializeFromDocument();
1098 } 1096 }