From a0e730636083eff0c757cd9e16698e3b8e0066c1 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 26 Apr 2012 17:05:45 -0700 Subject: Fixed the stage border and layout in the new template Signed-off-by: Valerio Virgillito --- .../layout/bread-crumb.reel/bread-crumb.js | 1 - js/document/document-html.js | 24 +++++++++++++++++++++- js/document/models/base.js | 8 ++++++++ js/stage/stage.reel/stage.js | 14 +++++-------- 4 files changed, 36 insertions(+), 11 deletions(-) (limited to 'js') diff --git a/js/components/layout/bread-crumb.reel/bread-crumb.js b/js/components/layout/bread-crumb.reel/bread-crumb.js index 597577f1..cf7b0685 100755 --- a/js/components/layout/bread-crumb.reel/bread-crumb.js +++ b/js/components/layout/bread-crumb.reel/bread-crumb.js @@ -81,7 +81,6 @@ exports.Breadcrumb = Montage.create(Component, { // This is always the top container which is now hardcoded to body this.containerElements.unshift({"node": parentNode, "nodeUuid":parentNode.uuid, "label": parentNode.nodeName}); - console.log("this works!"); } } diff --git a/js/document/document-html.js b/js/document/document-html.js index d9789cd2..89717dd6 100755 --- a/js/document/document-html.js +++ b/js/document/document-html.js @@ -32,7 +32,7 @@ exports.HtmlDocument = Montage.create(Component, { }, exclusionList: { - value: ["HTML"] + value: ["HTML", "BODY"] }, // Getters for the model. @@ -46,6 +46,24 @@ exports.HtmlDocument = Montage.create(Component, { } }, + isActive: { + get: function() { + return this.model._isActive; + }, + set: function(value) { + this.model._isActive = value; + } + }, + + needsSave: { + get: function() { + return this.model._needsSave; + }, + set: function(value) { + this.model._needsSave = value; + } + }, + // View Properties // TODO: Move those into a view object - for now dump it here iframe: { @@ -57,6 +75,10 @@ exports.HtmlDocument = Montage.create(Component, { return this._uuid; } }, + + currentView: { + value: "design" + }, //////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// init: { diff --git a/js/document/models/base.js b/js/document/models/base.js index 8925fc40..f237e793 100755 --- a/js/document/models/base.js +++ b/js/document/models/base.js @@ -25,6 +25,14 @@ exports.BaseDocumentModel = Montage.create(Montage, { _name: { value: null }, + + _isActive: { + value: null + }, + + _needsSave: { + value: null + }, //////////////////////////////////////////////////////////////////// // njdata: { diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js index fb7abf48..1ea14d64 100755 --- a/js/stage/stage.reel/stage.js +++ b/js/stage/stage.reel/stage.js @@ -224,14 +224,6 @@ exports.Stage = Montage.create(Component, { // Event details will contain the active document prior to opening a new one handleOpenDocument: { value: function(evt) { - - var prevActiveDocument = evt.detail; - // Hide current document is one is open - if(prevActiveDocument) { - prevActiveDocument.container.style["display"] = "none"; - if(prevActiveDocument.documentType === "htm" || prevActiveDocument.documentType === "html") this.hideCanvas(true); - } - this.hideCanvas(false); // Recalculate the canvas sizes because of splitter resizing @@ -254,7 +246,11 @@ exports.Stage = Montage.create(Component, { // Hardcode this value so that it does not fail for the new stage architecture // TODO: Remove marker for old template: NINJA-STAGE-REWORK - this.userContentBorder = 1; //parseInt(this._documentRoot.elementModel.controller.getProperty(this._documentRoot, "border")); + if(this.application.ninja.currentDocument.documentRoot.id === "UserContent") { + this.userContentBorder = 1; //parseInt(this._documentRoot.elementModel.controller.getProperty(this._documentRoot, "border")); + } else { + this.userContentBorder = 0; + } this._userContentLeft = this._documentOffsetLeft - this._scrollLeft + this._userContentBorder; this._userContentTop = this._documentOffsetTop - this._scrollTop + this._userContentBorder; -- cgit v1.2.3