From 6b65188b7a4a21ae1e575282fd5b6198b22ca7b7 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 10 May 2012 15:07:52 -0700 Subject: Fixing the live preview for the new document. Signed-off-by: Valerio Virgillito --- js/lib/NJUtils.js | 5 +++-- js/ninja.reel/ninja.js | 18 +++++++++++------- 2 files changed, 14 insertions(+), 9 deletions(-) (limited to 'js') 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, { ///// Quick "getElementById" $ : { - value: function(id) { - return document.getElementById(id); + value: function(id, doc) { + var _doc = doc || document; + return _doc.getElementById(id); } }, 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, { var background, overflow, transitionStopRule; this.stage.hideCanvas(this.appModel.livePreview); + // TODO: Remove marker for old template: NINJA-STAGE-REWORK if(this.appModel.livePreview) { - background = "#000000"; - overflow = "hidden"; +// background = "#000000"; +// overflow = "hidden"; transitionStopRule = "nj-css-garbage-selector"; } else { - background = "#808080"; - overflow = "visible"; +// background = "#808080"; +// overflow = "visible"; transitionStopRule = "*" } - this.currentDocument.documentRoot.elementModel.controller.setProperty(this.currentDocument.documentRoot, "body-background", background); - this.currentDocument.documentRoot.elementModel.controller.setProperty(this.currentDocument.documentRoot, "overflow", overflow); - this.currentDocument.documentRoot.elementModel.controller.changeSelector(this.currentDocument.documentRoot, "transitionStopRule", transitionStopRule); + // TODO: Remove marker for old template: NINJA-STAGE-REWORK +// this.currentDocument.documentRoot.elementModel.controller.setProperty(this.currentDocument.documentRoot, "body-background", background); +// this.currentDocument.documentRoot.elementModel.controller.setProperty(this.currentDocument.documentRoot, "overflow", overflow); +// this.currentDocument.documentRoot.elementModel.controller.changeSelector(this.currentDocument.documentRoot, "transitionStopRule", transitionStopRule); + + this.application.ninja.stylesController._stageStylesheet.rules[0].selectorText = transitionStopRule; this._toggleWebGlAnimation(this.appModel.livePreview); } -- cgit v1.2.3