From 3f8f224170937d498d3a03c706494408a6b4bf1d Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Mon, 23 Apr 2012 13:47:35 -0700 Subject: Temporary fix for the PI and Stage when opening the new template. Signed-off-by: Valerio Virgillito --- js/controllers/document-controller.js | 9 ++++++--- js/panels/properties.reel/properties.js | 5 +++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index a7aa0de6..4be0767a 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js @@ -473,7 +473,6 @@ var DocumentController = exports.DocumentController = Montage.create(Component, // Event Detail: Contains the current ActiveDocument _onOpenDocument: { value: function(doc){ - this.webTemplate = false; this.application.ninja.currentDocument = doc; this._hideCurrentDocument(); this.application.ninja.stage.stageView.hideOtherDocuments(doc.uuid); @@ -482,7 +481,11 @@ var DocumentController = exports.DocumentController = Montage.create(Component, this.activeDocument = doc; - this._showCurrentDocument(); + if(!this.webTemplate) { + this._showCurrentDocument(); + } + + this.webTemplate = false; NJevent("onOpenDocument", doc); } @@ -578,7 +581,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, this.application.ninja.stage.stageView.showRulers(); }else{ //hide the iframe when switching to code view - document.getElementById("iframeContainer").style.display="none"; + document.getElementById("iframeContainer").style.display = "none"; } } } diff --git a/js/panels/properties.reel/properties.js b/js/panels/properties.reel/properties.js index d9dca538..b21014c1 100755 --- a/js/panels/properties.reel/properties.js +++ b/js/panels/properties.reel/properties.js @@ -73,8 +73,9 @@ exports.Properties = Montage.create(Component, { this.eventManager.addEventListener( "elementChange", this, false); - // For now always assume that the stage is selected by default - if(this.application.ninja.selectedElements.length === 0) { + // For now always assume that the stage is selected by default when opening the old template + // TODO: Remove marker for old template: NINJA-STAGE-REWORK + if(this.application.ninja.selectedElements.length === 0 && this.application.ninja.currentDocument.documentRoot.nodeName.toLowerCase() !== "body") { this.displayStageProperties(); } } -- cgit v1.2.3