From 4b5cc9cf1f01552f61c08b9299b6e99366432e03 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 24 Apr 2012 15:36:03 -0700 Subject: Added a body controller Signed-off-by: Valerio Virgillito --- js/controllers/elements/body-controller.js | 44 ++++++++++++++++++++++ js/controllers/elements/controller-factory.js | 5 ++- js/data/pi/pi-data.js | 14 +++++++ js/document/document-html.js | 3 +- js/document/templates/montage-web/default_html.css | 2 +- js/document/templates/montage-web/index.html | 2 +- js/models/properties-3d.js | 3 +- 7 files changed, 67 insertions(+), 6 deletions(-) create mode 100755 js/controllers/elements/body-controller.js diff --git a/js/controllers/elements/body-controller.js b/js/controllers/elements/body-controller.js new file mode 100755 index 00000000..fbbb7c6e --- /dev/null +++ b/js/controllers/elements/body-controller.js @@ -0,0 +1,44 @@ +/* +This file contains proprietary software owned by Motorola Mobility, Inc.
+No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ + +var Montage = require("montage/core/core").Montage, + ElementController = require("js/controllers/elements/element-controller").ElementController; + +exports.BodyController = Montage.create(ElementController, { + + // TODO - perspective distance needs to be passed in as "dist" and matrix3d needs to be passed in as "mat" + set3DProperties: { + value: function(el, props, update3DModel) { + } + }, + + getProperty: { + value: function(el, p) { + } + }, + + setProperty: { + value: function(el, p, value) { + } + }, + + setAttribute: { + value: function(el, att, value) { + } + }, + + getPerspectiveDist: { + value: function(el) { + if(el.elementModel && el.elementModel.props3D && el.elementModel.props3D.perspectiveDist) { + return el.elementModel.props3D.perspectiveDist; + } else { + var dist = this.application.ninja.stylesController.getPerspectiveDistFromElement(el, true); + el.elementModel.props3D.perspectiveDist = dist; + return dist; + } + } + } +}); diff --git a/js/controllers/elements/controller-factory.js b/js/controllers/elements/controller-factory.js index a772eb16..1bbbbce0 100755 --- a/js/controllers/elements/controller-factory.js +++ b/js/controllers/elements/controller-factory.js @@ -6,7 +6,8 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot var Montage = require("montage/core/core").Montage; -var BlockController = require("js/controllers/elements/block-controller").BlockController, +var BodyController = require("js/controllers/elements/body-controller").BodyController, + BlockController = require("js/controllers/elements/block-controller").BlockController, StageController = require("js/controllers/elements/stage-controller").StageController, ShapesController = require("js/controllers/elements/shapes-controller").ShapesController, ImageController = require("js/controllers/elements/image-controller").ImageController, @@ -27,6 +28,8 @@ exports.ControllerFactory = Montage.create(Montage, { return BlockController; } else if(value.indexOf("stage") !== -1) { return StageController; + } else if(value.indexOf("body") !== -1) { + return BodyController; } else if(value.indexOf("shape") !== -1) { return ShapesController; } else if(value.indexOf("canvas") !== -1) { diff --git a/js/data/pi/pi-data.js b/js/data/pi/pi-data.js index 157c54ec..65161b4f 100755 --- a/js/data/pi/pi-data.js +++ b/js/data/pi/pi-data.js @@ -9,6 +9,20 @@ var Montage = require("montage/core/core").Montage, exports.PiData = Montage.create( Montage, { + bodyPi: { + value: [ + { + label: "Style", + + Section: [ + [ + + ] + ] + } + ] + }, + stagePi: { value: [ { diff --git a/js/document/document-html.js b/js/document/document-html.js index 8cb88516..b19ca0d0 100755 --- a/js/document/document-html.js +++ b/js/document/document-html.js @@ -270,7 +270,8 @@ exports.HtmlDocument = Montage.create(Component, { //TODO Finish this implementation once we start caching Core Elements // Assign a model to the UserContent and add the ViewPort reference to it. - document.application.njUtils.makeElementModel(this.documentRoot, "Stage", "stage"); + document.application.njUtils.makeElementModel(this.documentRoot, "Body", "body"); +// this.documentRoot.elementModel.props3D.init(this.documentRoot, true); for(i = 0; i < this._stylesheets.length; i++) { if(this._stylesheets[i].ownerNode.id === "nj-stage-stylesheet") { diff --git a/js/document/templates/montage-web/default_html.css b/js/document/templates/montage-web/default_html.css index db069d4e..08e39f22 100755 --- a/js/document/templates/montage-web/default_html.css +++ b/js/document/templates/montage-web/default_html.css @@ -11,7 +11,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot } .active-element-outline { - outline: #adff2f solid 2px; + outline: #adff2f solid 2px; } .nj-preset-transition { diff --git a/js/document/templates/montage-web/index.html b/js/document/templates/montage-web/index.html index 90b0f7fd..c52a5394 100755 --- a/js/document/templates/montage-web/index.html +++ b/js/document/templates/montage-web/index.html @@ -42,7 +42,7 @@ -
IPSUM
+ diff --git a/js/models/properties-3d.js b/js/models/properties-3d.js index c1270c3b..e571e505 100755 --- a/js/models/properties-3d.js +++ b/js/models/properties-3d.js @@ -5,8 +5,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot */ var Montage = require("montage/core/core").Montage, - Component = require("montage/ui/component").Component, - NJUtils = require("js/lib/NJUtils").NJUtils; + Component = require("montage/ui/component").Component; exports.Properties3D = Montage.create(Component, { -- cgit v1.2.3 From 1ccc4d6dcff232b00763a5a49d7ad7a91f78ad3f Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 26 Apr 2012 13:24:51 -0700 Subject: Fixing the element model and adding get element Signed-off-by: Valerio Virgillito --- js/document/document-html.js | 6 ++++++ js/document/html-document.js | 10 +++++++--- js/lib/NJUtils.js | 14 ++++++------- js/models/element-model.js | 35 ++++++++++++++++++--------------- js/panels/properties.reel/properties.js | 1 + 5 files changed, 39 insertions(+), 27 deletions(-) diff --git a/js/document/document-html.js b/js/document/document-html.js index b19ca0d0..24eb4f47 100755 --- a/js/document/document-html.js +++ b/js/document/document-html.js @@ -310,6 +310,12 @@ exports.HtmlDocument = Montage.create(Component, { } }, + GetElementFromPoint: { + value: function(x, y) { + return this._window.getElement(x,y); + } + }, + // Handler for user content main reel. Gets called once the main reel of the template // gets deserialized. // Setting up the currentSelectedContainer to the document body. diff --git a/js/document/html-document.js b/js/document/html-document.js index 3876670c..3dbf96ce 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js @@ -759,10 +759,14 @@ exports.HTMLDocument = Montage.create(TextDocument, { //TODO Finish this implementation once we start caching Core Elements // Assign a model to the UserContent and add the ViewPort reference to it. NJUtils.makeElementModel(this.documentRoot, "Stage", "stage"); - //this.documentRoot.elementModel.viewPort = this.iframe.contentWindow.document.getElementById("Viewport"); - NJUtils.makeElementModel(this.stageBG, "Stage", "stage"); + NJUtils.makeElementModel(this.stageBG, "Stage", "stage"); NJUtils.makeElementModel(this.iframe.contentWindow.document.getElementById("Viewport"), "Stage", "stage"); - + + // Initialize the 3D properties + this.documentRoot.elementModel.props3D.init(this.documentRoot, true); + this.stageBG.elementModel.props3D.init(this.stageBG, true); + this.iframe.contentWindow.document.getElementById("Viewport").elementModel.props3D.init(this.iframe.contentWindow.document.getElementById("Viewport"), true); + for(i = 0; i < this._stylesheets.length; i++) { if(this._stylesheets[i].ownerNode.id === this._stageStyleSheetId) { this.documentRoot.elementModel.defaultRule = this._stylesheets[i]; diff --git a/js/lib/NJUtils.js b/js/lib/NJUtils.js index 67bb59c4..dae128e4 100755 --- a/js/lib/NJUtils.js +++ b/js/lib/NJUtils.js @@ -94,10 +94,10 @@ exports.NJUtils = Object.create(Object.prototype, { ///// TODO: find a different place for this function makeElementModel: { value: function(el, selection, controller, isShape) { + //el.elementModel = Montage.create(ElementModel).initialize(el.nodeName, selection, controller, isShape); + var p3d = Montage.create(Properties3D); - if(selection === "Stage") { - p3d.init(el, true); - } + var shapeProps = null; var pi = controller + "Pi"; @@ -143,6 +143,7 @@ exports.NJUtils = Object.create(Object.prototype, { isShape: { value: isShape} }); + } }, @@ -167,15 +168,12 @@ exports.NJUtils = Object.create(Object.prototype, { break; case "canvas": isShape = el.getAttribute("data-RDGE-id"); - if(isShape) - { + if(isShape) { // TODO - Need more info about the shape selection = "canvas"; controller = "shape"; isShape = true; - } - else - { + } else { selection = "canvas"; controller = "canvas"; } diff --git a/js/models/element-model.js b/js/models/element-model.js index fa02fd38..0e199a67 100755 --- a/js/models/element-model.js +++ b/js/models/element-model.js @@ -4,7 +4,10 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. */ -var Montage = require("montage/core/core").Montage; +var Montage = require("montage/core/core").Montage, + Properties3D = require("js/models/properties-3d").Properties3D, + ShapeModel = require("js/models/shape-model").ShapeModel, + ControllerFactory = require("js/controllers/elements/controller-factory").ControllerFactory; exports.ElementModel = Montage.create(Montage, { key: { value: "_model_"}, @@ -16,36 +19,36 @@ exports.ElementModel = Montage.create(Montage, { id: { value: "" }, classList: { value: null }, - defaultRule: { value: null }, top: { value: null }, left: { value: null }, width: { value: null }, height: { value: null }, - - /** - * Properties 3D - */ props3D: { value: null }, - /** - * Shape Info - */ isShape: { value: false }, shapeModel: { value: null }, - - /** - * SnapManager 2d Snap Cache Info - */ isIn2DSnapCache : { value: false }, - /** - * Color info - */ fill: { value: null }, stroke: { value: null }, + initialize: { + value: function(type, selection, controller, isShape) { + /* + this.type = type; + this.selection = selection; + + controller: { value: ControllerFactory.getController(controller)}, + pi: { value: pi}, + props3D: { value: p3d}, + shapeModel: { value: shapeProps}, + isShape: { value: isShape} + */ + } + }, + getProperty: { value: function(property) { var key = this.key + property; diff --git a/js/panels/properties.reel/properties.js b/js/panels/properties.reel/properties.js index b21014c1..ee90cd64 100755 --- a/js/panels/properties.reel/properties.js +++ b/js/panels/properties.reel/properties.js @@ -174,6 +174,7 @@ exports.Properties = Montage.create(Component, { handleSelectionChange: { value: function(event) { if(event.detail.isDocument) { + if(this.application.ninja.currentDocument.documentRoot.nodeName.toLowerCase() === "body") return; this.displayStageProperties(); } else { if(this.application.ninja.selectedElements.length === 1) { -- cgit v1.2.3 From 238586be0df568c6804268d97bf9d3ef7cd33fda Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 26 Apr 2012 15:33:48 -0700 Subject: Simplifying the getElement method from stage and adding an exclusion list to the new template Signed-off-by: Valerio Virgillito --- js/document/document-html.js | 15 ++++++++ js/stage/stage.reel/stage.js | 73 +++++++++++++++++++-------------------- js/tools/EyedropperTool.js | 2 +- js/tools/FillTool.js | 2 +- js/tools/InkBottleTool.js | 2 +- js/tools/ShapeTool.js | 2 +- js/tools/ToolBase.js | 4 +-- js/tools/TranslateObject3DTool.js | 2 +- js/tools/modifier-tool-base.js | 2 +- 9 files changed, 58 insertions(+), 46 deletions(-) diff --git a/js/document/document-html.js b/js/document/document-html.js index 24eb4f47..d9789cd2 100755 --- a/js/document/document-html.js +++ b/js/document/document-html.js @@ -31,6 +31,10 @@ exports.HtmlDocument = Montage.create(Component, { value: null }, + exclusionList: { + value: ["HTML"] + }, + // Getters for the model. // TODO: Change how these properties are accessed through Ninja name: { @@ -316,6 +320,17 @@ exports.HtmlDocument = Montage.create(Component, { } }, + inExclusion: { + value: function(element) { + if(this.exclusionList.indexOf(element.nodeName) === -1) { + return -1; + } + + return 1; + + } + }, + // Handler for user content main reel. Gets called once the main reel of the template // gets deserialized. // Setting up the currentSelectedContainer to the document body. diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js index 8382135d..fb7abf48 100755 --- a/js/stage/stage.reel/stage.js +++ b/js/stage/stage.reel/stage.js @@ -521,62 +521,59 @@ exports.Stage = Montage.create(Component, { }, /** - * GetSelectableElement: Returns a selectable object (direct child of current container) at clicked point + * GetElement: Returns the element or selectable element under the X,Y coordinates passed as an obj with x,y * - * @param: X,Y - * @return: Returns the current container if the the X,Y hits an element in the exclusion list + * @param position: mouse event + * @param selectable (default == null) if true this will return the current container element + * @return: Returns the element or container or null if the the X,Y hits the exclusion list and tool cannot operate on stage */ - GetSelectableElement: { - value: function(pos) { - var item = this.GetElement(pos); - if(this.application.ninja.currentDocument.inExclusion(item) !== -1) { - return this.application.ninja.currentSelectedContainer; + getElement: { + value: function(position, selectable) { + var point, element; + + point = webkitConvertPointFromPageToNode(this.canvas, new WebKitPoint(position.pageX, position.pageY)); + element = this.application.ninja.currentDocument.GetElementFromPoint(point.x + this.scrollLeft,point.y + this.scrollTop); + + // workaround Chrome 3d bug + if(this.application.ninja.toolsData.selectedToolInstance._canSnap && this.application.ninja.currentDocument.inExclusion(element) !== -1) { + element = this.getElementUsingSnapping(point); } - var activeContainerId = this.application.ninja.currentSelectedContainer.uuid; - if(item.parentNode.uuid === activeContainerId) { - return item; - } else { - var outerElement = item.parentNode; - while(outerElement.parentNode && outerElement.parentNode.uuid !== activeContainerId) { - // If element is higher up than current container then return - if(outerElement.id === "UserContent") return; - // else keep going up the chain - outerElement = outerElement.parentNode; + if(selectable) { + + if(this.application.ninja.currentDocument.inExclusion(element) !== -1) { + return this.application.ninja.currentSelectedContainer; } - return outerElement; - } - } - }, + var activeContainerId = this.application.ninja.currentSelectedContainer.uuid; + if(element.parentNode.uuid === activeContainerId) { + return element; + } else { + var outerElement = element.parentNode; - /** - * GetElement: Returns the object under the X,Y coordinates passed as an obj with x,y - * - * @param: X,Y - * @return: Returns the Object or null if the the X,Y hits the exclusion list and tool cannot operate on stage - */ - GetElement: { - value: function(pos) { - var point = webkitConvertPointFromPageToNode(this.canvas, new WebKitPoint(pos.pageX, pos.pageY)), - elt = this.application.ninja.currentDocument.GetElementFromPoint(point.x + this.scrollLeft,point.y + this.scrollTop); + while(outerElement.parentNode && outerElement.parentNode.uuid !== activeContainerId) { + // If element is higher up than current container then return + if(outerElement.id === "UserContent") return; + // else keep going up the chain + outerElement = outerElement.parentNode; + } + + return outerElement; + } - // workaround Chrome 3d bug - if(this.application.ninja.toolsData.selectedToolInstance._canSnap && this.application.ninja.currentDocument.inExclusion(elt) !== -1) { - return this._getElementUsingSnapping(point); } else { - return elt; + return element; } } }, /** - * _getElementUsingSnapping: Returns the object at point using snap manager + * getElementUsingSnapping: Returns the object at point using snap manager * * @param: point * @return: Returns the Object in the user document under the point */ - _getElementUsingSnapping: { + getElementUsingSnapping: { value: function(point) { this.stageDeps.snapManager.enableElementSnap( true ); var hitRec = this.stageDeps.snapManager.snap(point.x, point.y, true); diff --git a/js/tools/EyedropperTool.js b/js/tools/EyedropperTool.js index d627f03b..346975b2 100755 --- a/js/tools/EyedropperTool.js +++ b/js/tools/EyedropperTool.js @@ -104,7 +104,7 @@ exports.EyedropperTool = Montage.create(toolBase, { value : function (event) { var c, color, - obj = this.application.ninja.stage.GetElement(event); + obj = this.application.ninja.stage.getElement(event); if (obj) { if(this.application.ninja.currentDocument.inExclusion(obj) !== -1) diff --git a/js/tools/FillTool.js b/js/tools/FillTool.js index 746f20cf..87a093ff 100755 --- a/js/tools/FillTool.js +++ b/js/tools/FillTool.js @@ -22,7 +22,7 @@ exports.FillTool = Montage.create(ModifierToolBase, { HandleMouseMove: { value : function (event) { - var obj = this.application.ninja.stage.GetSelectableElement(event); + var obj = this.application.ninja.stage.getElement(event, true); var cursor = "url('images/cursors/fill.png') 14 14, default"; var canColor = true; if (obj) diff --git a/js/tools/InkBottleTool.js b/js/tools/InkBottleTool.js index 960c19fa..fd17f4d6 100755 --- a/js/tools/InkBottleTool.js +++ b/js/tools/InkBottleTool.js @@ -16,7 +16,7 @@ exports.InkBottleTool = Montage.create(ModifierToolBase, { HandleMouseMove: { value : function (event) { - var obj = this.application.ninja.stage.GetSelectableElement(event); + var obj = this.application.ninja.stage.getElement(event, true); var cursor = "url('images/cursors/ink.png') 6 11, default"; var canColor = true; if (obj) diff --git a/js/tools/ShapeTool.js b/js/tools/ShapeTool.js index f3b5e92d..21a5a025 100755 --- a/js/tools/ShapeTool.js +++ b/js/tools/ShapeTool.js @@ -138,7 +138,7 @@ exports.ShapeTool = Montage.create(DrawingTool, { _showFeedbackOnMouseMove: { value: function (event) { // TODO - This call is causing the canvas to redraw 3 times per mouse move - var targetedObject = this.application.ninja.stage.GetSelectableElement(event); + var targetedObject = this.application.ninja.stage.getElement(event, true); if (targetedObject) { if((targetedObject.nodeName === "CANVAS") && !ShapesController.isElementAShape(targetedObject)) diff --git a/js/tools/ToolBase.js b/js/tools/ToolBase.js index 69ac5727..f43b1b58 100755 --- a/js/tools/ToolBase.js +++ b/js/tools/ToolBase.js @@ -89,9 +89,9 @@ exports.toolBase = Montage.create(Component, { if(this._canOperateOnStage) { if(event.shiftKey) { - this.application.ninja.selectionController.shiftSelectElement(this.application.ninja.stage.GetElement(event)); + this.application.ninja.selectionController.shiftSelectElement(this.application.ninja.stage.getElement(event)); } else { - this.application.ninja.selectionController.selectElement(this.application.ninja.stage.GetElement(event)); + this.application.ninja.selectionController.selectElement(this.application.ninja.stage.getElement(event)); } } diff --git a/js/tools/TranslateObject3DTool.js b/js/tools/TranslateObject3DTool.js index 72a55322..b4f55bd9 100755 --- a/js/tools/TranslateObject3DTool.js +++ b/js/tools/TranslateObject3DTool.js @@ -83,7 +83,7 @@ exports.TranslateObject3DTool = Montage.create(Translate3DToolBase, { // Check that hitRec's element matches element that browser says we clicked on // TODO - This is still not working when using a handle that is on top of an // element that is not currently selected - var elt = this.application.ninja.stage.GetSelectableElement(event); + var elt = this.application.ninja.stage.getElement(event, true); if(elt && (elt !== hitRec.getElement())) { hitRec = snapManager.findHitRecordForElement(elt); diff --git a/js/tools/modifier-tool-base.js b/js/tools/modifier-tool-base.js index 2e006c35..d023206a 100755 --- a/js/tools/modifier-tool-base.js +++ b/js/tools/modifier-tool-base.js @@ -134,7 +134,7 @@ exports.ModifierToolBase = Montage.create(DrawingTool, { var hitRec = snapManager.snap(point.x, point.y, do3DSnap); // TODO - Check that hitRec's element matches element that browser says we clicked on - var elt = this.application.ninja.stage.GetSelectableElement(event); + var elt = this.application.ninja.stage.getElement(event, true); if(elt !== hitRec.getElement()) { hitRec = snapManager.findHitRecordForElement(elt); -- cgit v1.2.3 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(-) 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