aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorValerio Virgillito2012-05-10 15:07:52 -0700
committerValerio Virgillito2012-05-10 15:07:52 -0700
commit6b65188b7a4a21ae1e575282fd5b6198b22ca7b7 (patch)
treea9432d002596de45da0493715d87b8fa285ff66f /js
parent254e2f8ee3e915c7dafe445c724b88434fb52f28 (diff)
downloadninja-6b65188b7a4a21ae1e575282fd5b6198b22ca7b7.tar.gz
Fixing the live preview for the new document.
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js')
-rwxr-xr-xjs/lib/NJUtils.js5
-rwxr-xr-xjs/ninja.reel/ninja.js18
2 files changed, 14 insertions, 9 deletions
diff --git a/js/lib/NJUtils.js b/js/lib/NJUtils.js
index 5aaeb5f2..d0f547f5 100755
--- a/js/lib/NJUtils.js
+++ b/js/lib/NJUtils.js
@@ -18,8 +18,9 @@ exports.NJUtils = Montage.create(Component, {
18 18
19 ///// Quick "getElementById" 19 ///// Quick "getElementById"
20 $ : { 20 $ : {
21 value: function(id) { 21 value: function(id, doc) {
22 return document.getElementById(id); 22 var _doc = doc || document;
23 return _doc.getElementById(id);
23 } 24 }
24 }, 25 },
25 26
diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js
index 4d7d883d..f518378a 100755
--- a/js/ninja.reel/ninja.js
+++ b/js/ninja.reel/ninja.js
@@ -284,19 +284,23 @@ exports.Ninja = Montage.create(Component, {
284 var background, overflow, transitionStopRule; 284 var background, overflow, transitionStopRule;
285 this.stage.hideCanvas(this.appModel.livePreview); 285 this.stage.hideCanvas(this.appModel.livePreview);
286 286
287 // TODO: Remove marker for old template: NINJA-STAGE-REWORK
287 if(this.appModel.livePreview) { 288 if(this.appModel.livePreview) {
288 background = "#000000"; 289// background = "#000000";
289 overflow = "hidden"; 290// overflow = "hidden";
290 transitionStopRule = "nj-css-garbage-selector"; 291 transitionStopRule = "nj-css-garbage-selector";
291 } else { 292 } else {
292 background = "#808080"; 293// background = "#808080";
293 overflow = "visible"; 294// overflow = "visible";
294 transitionStopRule = "*" 295 transitionStopRule = "*"
295 } 296 }
296 297
297 this.currentDocument.documentRoot.elementModel.controller.setProperty(this.currentDocument.documentRoot, "body-background", background); 298 // TODO: Remove marker for old template: NINJA-STAGE-REWORK
298 this.currentDocument.documentRoot.elementModel.controller.setProperty(this.currentDocument.documentRoot, "overflow", overflow); 299// this.currentDocument.documentRoot.elementModel.controller.setProperty(this.currentDocument.documentRoot, "body-background", background);
299 this.currentDocument.documentRoot.elementModel.controller.changeSelector(this.currentDocument.documentRoot, "transitionStopRule", transitionStopRule); 300// this.currentDocument.documentRoot.elementModel.controller.setProperty(this.currentDocument.documentRoot, "overflow", overflow);
301// this.currentDocument.documentRoot.elementModel.controller.changeSelector(this.currentDocument.documentRoot, "transitionStopRule", transitionStopRule);
302
303 this.application.ninja.stylesController._stageStylesheet.rules[0].selectorText = transitionStopRule;
300 304
301 this._toggleWebGlAnimation(this.appModel.livePreview); 305 this._toggleWebGlAnimation(this.appModel.livePreview);
302 } 306 }