From eff40602cac6821f8272177c24b6bf3de399f8b1 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 17 May 2012 21:11:33 -0700 Subject: multiple documents - enable opening multiple documents and initial switching Signed-off-by: Valerio Virgillito --- js/controllers/document-controller.js | 71 +++++++++++++++++------------------ js/document/document-html.js | 2 - 2 files changed, 35 insertions(+), 38 deletions(-) (limited to 'js') diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index cf46e73e..50874725 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js @@ -454,58 +454,57 @@ var DocumentController = exports.DocumentController = Montage.create(Component, // Open document callback _onOpenDocument: { value: function(doc){ - + var currentDocument; if(this.activeDocument) { // There is a document currently opened - - + currentDocument = this.activeDocument; //this.application.ninja.stage.stageView.showCodeViewBar(false); //this.application.ninja.stage.stageView.restoreAllPanels(); - // - /* - if(this.activeDocument.currentView === "design"){ - this.activeDocument.saveAppState(); - this.activeDocument.container.parentNode.style["display"] = "none"; - this.application.ninja.stage.hideCanvas(true); - this.application.ninja.stage.stageView.hideRulers(); - } + //this.activeDocument.saveAppState(); - this.activeDocument.container.style["display"] = "none"; - */ - - /* - this.activeDocument.container.style["display"] = "block"; - if(this.activeDocument.currentView === "design"){ - this.activeDocument.container.parentNode.style["display"] = "block"; - this.activeDocument.restoreAppState(); - }else{ - //hide the iframe when switching to code view - document.getElementById("iframeContainer").style.display = "none"; - } - - */ - // hide current document + // TODO: Do we need this? + //this.application.ninja.stage.hideCanvas(true); + //this.application.ninja.stage.stageView.hideRulers(); + + //this.activeDocument.restoreAppState(); } else { // There is no document opened - // Set the active document - this.activeDocument = doc; + // Show the rulers + // TODO: Move this indo design view + this.application.ninja.stage.stageView.showRulers(); // Show the canvas this.application.ninja.stage.hideCanvas(false); + } - // Show the rulers - // TODO: Move this indo design view - this.application.ninja.stage.stageView.showRulers(); - // Initialize the documentRoot styles - this.initializeRootStyles(doc.documentRoot); - // Flag to stop stylesheet dirty event - this._hackInitialStyles = false; + // Set the active document + this.activeDocument = doc; + + // Initialize the documentRoot styles + this.initializeRootStyles(doc.documentRoot); + // Flag to stop stylesheet dirty event + this._hackInitialStyles = false; + + this.switchDocuments(currentDocument, doc); + + NJevent("onOpenDocument", doc); + + //Setting opacity to be viewable after load + //doc.model.views.design.iframe.style.opacity = 1; + + } + }, + + switchDocuments: { + value: function(current, newDocument) { + newDocument.model.views.design.iframe.style.opacity = 1; - NJevent("onOpenDocument", doc); + if(current) { + current.model.views.design.hide(); } } }, diff --git a/js/document/document-html.js b/js/document/document-html.js index 56d9db02..c77ed7bc 100755 --- a/js/document/document-html.js +++ b/js/document/document-html.js @@ -119,8 +119,6 @@ exports.HtmlDocument = Montage.create(Component, { this._observer = null; //Making callback after view is loaded this.loaded.callback.call(this.loaded.context, this); - //Setting opacity to be viewable after load - this.model.views.design.iframe.style.opacity = 1; } }, //////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From b72c5f72ea5df4aa164350e1ba66fd1b4e23369d Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 17 May 2012 23:07:48 -0700 Subject: removing all stageDeps for drawing classes. Signed-off-by: Valerio Virgillito --- js/helper-classes/3D/draw-utils.js | 2 +- js/helper-classes/3D/snap-manager.js | 13 ++------ js/helper-classes/3D/view-utils.js | 53 ++++++++++++------------------- js/stage/stage-deps.js | 61 +++++------------------------------- js/stage/stage.reel/stage.html | 3 -- js/tools/drawing-tool-base.js | 39 ++++++++--------------- 6 files changed, 45 insertions(+), 126 deletions(-) (limited to 'js') diff --git a/js/helper-classes/3D/draw-utils.js b/js/helper-classes/3D/draw-utils.js index a6d2d899..a8bc16ef 100755 --- a/js/helper-classes/3D/draw-utils.js +++ b/js/helper-classes/3D/draw-utils.js @@ -138,7 +138,7 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, { l, t, plane, - elt + elt; for(i=0; i --- js/helper-classes/3D/draw-utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js') diff --git a/js/helper-classes/3D/draw-utils.js b/js/helper-classes/3D/draw-utils.js index a8bc16ef..bf48a723 100755 --- a/js/helper-classes/3D/draw-utils.js +++ b/js/helper-classes/3D/draw-utils.js @@ -124,7 +124,7 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, { this._eltArray = []; this._planesArray = []; this.setDrawingSurfaceElement(stage.canvas); - this.setSourceSpaceElement( stage.stageDeps.currentStage ); + this.setSourceSpaceElement( this.application.ninja.currentDocument.documentRoot); this.setWorkingPlane( [0,0,1,0] ); //Loop through all the top-level children of the current document and call drawUtils.addElement on them -- cgit v1.2.3 From 7a94696e19b14e15261df516e2ba75e693b1313d Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 18 May 2012 00:21:56 -0700 Subject: enabling basic document switching Signed-off-by: Valerio Virgillito --- .../layout/document-entry.reel/document-entry.js | 4 +- js/controllers/document-controller.js | 37 +++++----- js/controllers/selection-controller.js | 4 +- js/document/document-html.js | 20 +++++- js/document/html-document.js | 78 +--------------------- js/document/models/base.js | 2 +- js/ninja.reel/ninja.js | 17 ++++- js/panels/properties.reel/properties.js | 16 ----- js/stage/stage-deps.js | 13 ++-- js/stage/stage-view.reel/stage-view.js | 22 ------ 10 files changed, 59 insertions(+), 154 deletions(-) (limited to 'js') diff --git a/js/components/layout/document-entry.reel/document-entry.js b/js/components/layout/document-entry.reel/document-entry.js index ad0236c6..50b3624c 100755 --- a/js/components/layout/document-entry.reel/document-entry.js +++ b/js/components/layout/document-entry.reel/document-entry.js @@ -121,8 +121,8 @@ exports.DocumentEntry = Montage.create(Component, { if(event._event.target.nodeName === "IMG") { this.application.ninja.documentController.closeFile(this.application.ninja.documentController._findDocumentByUUID(this._uuid)); } else { - if(!this._document.isActive) { - this.application.ninja.stage.stageView.switchDocument(this.application.ninja.documentController._findDocumentByUUID(this._uuid)); + if(!this.active) { + this.application.ninja.documentController.switchDocuments(this.application.ninja.currentDocument, this.application.ninja.documentController._findDocumentByUUID(this._uuid)); } } } diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index 50874725..fc1f2c0f 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js @@ -459,16 +459,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, // There is a document currently opened currentDocument = this.activeDocument; - //this.application.ninja.stage.stageView.showCodeViewBar(false); //this.application.ninja.stage.stageView.restoreAllPanels(); - - //this.activeDocument.saveAppState(); - - // TODO: Do we need this? - //this.application.ninja.stage.hideCanvas(true); - //this.application.ninja.stage.stageView.hideRulers(); - - //this.activeDocument.restoreAppState(); } else { // There is no document opened @@ -480,7 +471,6 @@ var DocumentController = exports.DocumentController = Montage.create(Component, this.application.ninja.stage.hideCanvas(false); } - // Set the active document this.activeDocument = doc; @@ -489,22 +479,27 @@ var DocumentController = exports.DocumentController = Montage.create(Component, // Flag to stop stylesheet dirty event this._hackInitialStyles = false; - this.switchDocuments(currentDocument, doc); - - NJevent("onOpenDocument", doc); - - //Setting opacity to be viewable after load - //doc.model.views.design.iframe.style.opacity = 1; - + this.switchDocuments(currentDocument, doc, true); } }, switchDocuments: { - value: function(current, newDocument) { - newDocument.model.views.design.iframe.style.opacity = 1; + value: function(currentDocument, newDocument, didCreate) { + + if(currentDocument) { + currentDocument.serializeDocument(); - if(current) { - current.model.views.design.hide(); + currentDocument.model.views.design.hide(); + } + + if(didCreate) { + newDocument.model.views.design.iframe.style.opacity = 1; + NJevent("onOpenDocument", newDocument); + } else { + this.activeDocument = newDocument; + newDocument.model.views.design.show(); + newDocument.deserializeDocument(); + NJevent("switchDocument"); } } }, diff --git a/js/controllers/selection-controller.js b/js/controllers/selection-controller.js index 6e40abb5..1092615a 100755 --- a/js/controllers/selection-controller.js +++ b/js/controllers/selection-controller.js @@ -81,10 +81,10 @@ exports.SelectionController = Montage.create(Component, { handleSwitchDocument: { value: function() { - if(this.application.ninja.documentController.activeDocument.currentView === "design"){ +// if(this.application.ninja.documentController.activeDocument.currentView === "design"){ this._isDocument = this.application.ninja.selectedElements.length === 0; NJevent("selectionChange", {"elements": this.application.ninja.selectedElements, "isDocument": this._isDocument} ); - } +// } } }, diff --git a/js/document/document-html.js b/js/document/document-html.js index c77ed7bc..0037c94d 100755 --- a/js/document/document-html.js +++ b/js/document/document-html.js @@ -134,7 +134,7 @@ exports.HtmlDocument = Montage.create(Component, { // serializeDocument: { value: function () { - // There are not needed for now ssince we cannot change them + // There are not needed for now since we cannot change them //this.gridHorizontalSpacing = this.application.ninja.stage.drawUtils.gridHorizontalSpacing; //this.gridVerticalSpacing = this.application.ninja.stage.drawUtils.gridVerticalSpacing; @@ -150,13 +150,29 @@ exports.HtmlDocument = Montage.create(Component, { // Pause the videos this.model.views.design.pauseVideos(); + + this.model.isActive = false; } }, //////////////////////////////////////////////////////////////////// // deserializeDocument: { value: function () { - //TODO: Import functionality + // There are not needed for now since we cannot change them + //this.application.ninja.stage.drawUtils.gridHorizontalSpacing = this.gridHorizontalSpacing; + //this.application.ninja.stage.drawUtils.gridVerticalSpacing = this.gridVerticalSpacing; + + // Deserialize the current scroll position + // TODO: Implement + + this.application.ninja.selectedElements = this.model.selection.slice(0); + + this.application.ninja.appModel.show3dGrid = this.draw3DGrid; + + // Serialize the undo + // TODO: Save the montage undo queue + + this.model.isActive = true; } } //////////////////////////////////////////////////////////////////// diff --git a/js/document/html-document.js b/js/document/html-document.js index 68c2a9fb..bcf2b5c2 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js @@ -454,55 +454,6 @@ exports.HTMLDocument = Montage.create(TextDocument, { } }, - /** - * Return the specified inline attribute from the element. - */ - GetElementAttribute: { - value: function(element, attribute) { - - var value; - - if(attribute === "src") { - return element[attribute].replace(window.location.href, ''); - } - - value = element[attribute]; - - if(value !== undefined) return value; -// if(value || value === false) return [value, "inline"]; - - // 3. - //value = this._document.defaultView.getComputedStyle(element,null).getPropertyValue(attribute); - //if(value) return value; - - return null; - } - }, - - GetElementStyle: { - value: function(element, style) { -// return this._queryStylesheets(element, style); - } - }, - - SetStyle: { - value: function(type, selector, style, value) { - try { - for(var j=0; j --- js/helper-classes/3D/snap-manager.js | 7 +++++++ js/ninja.reel/ninja.js | 15 +++++++++++++-- js/stage/stage-deps.js | 5 +++-- 3 files changed, 23 insertions(+), 4 deletions(-) (limited to 'js') diff --git a/js/helper-classes/3D/snap-manager.js b/js/helper-classes/3D/snap-manager.js index 7194524e..e22ac3ad 100755 --- a/js/helper-classes/3D/snap-manager.js +++ b/js/helper-classes/3D/snap-manager.js @@ -456,6 +456,13 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { } }, + reload2DCache: { + value: function() { + this.clear2DCache(); + this.load2DCache(workingPlane); + } + }, + clear2DCache : { value : function() { // clear the 2D cache flags in the objects diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index ba87e2d5..067a005f 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js @@ -134,10 +134,21 @@ exports.Ninja = Montage.create(Component, { value: [] }, - currentSelectedContainer: { + _currentSelectedContainer: { value: null }, + currentSelectedContainer: { + get: function() { + return this._currentSelectedContainer; + }, + set: function(value) { + if(value !== this._currentSelectedContainer) { + this._currentSelectedContainer = value; + } + } + }, + templateDidLoad: { value: function() { this.ninjaVersion = window.ninjaVersion.ninja.version; @@ -285,7 +296,7 @@ exports.Ninja = Montage.create(Component, { this.currentDocument = this.documentController.activeDocument; if(this.currentDocument.documentRoot) { - this.application.ninja.currentSelectedContainer = this.currentDocument.documentRoot; + this._currentSelectedContainer = this.selectionController._currentSelectedContainer = this.currentDocument.documentRoot; } } }, diff --git a/js/stage/stage-deps.js b/js/stage/stage-deps.js index 84f04249..0d53696b 100755 --- a/js/stage/stage-deps.js +++ b/js/stage/stage-deps.js @@ -105,7 +105,7 @@ exports.StageDeps = Montage.create(Component, { workingPlane = [0,0,1,0]; - snapManager._isCacheInvalid = true; + snapManager.reload2DCache(); snapManager.setupDragPlaneFromPlane (workingPlane); drawUtils.initializeFromDocument(); @@ -116,8 +116,9 @@ exports.StageDeps = Montage.create(Component, { value: function(){ workingPlane = [0,0,1,0]; - snapManager._isCacheInvalid = true; snapManager.setupDragPlaneFromPlane (workingPlane); + snapManager.reload2DCache(); + drawUtils.initializeFromDocument(); } -- cgit v1.2.3 From 8247cddcc7ddce25a6282e97d304cad9a0f0c4f3 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 18 May 2012 01:06:31 -0700 Subject: fixed the shape subtool not refreshing the icon Signed-off-by: Valerio Virgillito --- js/components/layout/tool-button.reel/tool-button.html | 4 ++++ js/components/layout/tool-button.reel/tool-button.js | 11 ----------- js/components/layout/tools-list.reel/tools-list.html | 12 ++---------- js/data/tools-data.js | 13 +++++++++++++ 4 files changed, 19 insertions(+), 21 deletions(-) (limited to 'js') diff --git a/js/components/layout/tool-button.reel/tool-button.html b/js/components/layout/tool-button.reel/tool-button.html index 84a6d34e..a329f646 100755 --- a/js/components/layout/tool-button.reel/tool-button.html +++ b/js/components/layout/tool-button.reel/tool-button.html @@ -16,6 +16,10 @@ "prototype": "js/components/layout/tool-button.reel", "properties": { "element": {"#": "toolBarButton"} + }, + "bindings": { + "selected": {"<<->": "@owner.data.selected"}, + "subselected": {"<-": "@owner.data.subtools.selected"} } } } diff --git a/js/components/layout/tool-button.reel/tool-button.js b/js/components/layout/tool-button.reel/tool-button.js index 6cea0dc3..6008c4ec 100755 --- a/js/components/layout/tool-button.reel/tool-button.js +++ b/js/components/layout/tool-button.reel/tool-button.js @@ -48,19 +48,8 @@ exports.ToolButton = Montage.create(Component, { this.element.addEventListener("mousedown", this, false); this.element.addEventListener("dblclick", this, false); - Object.defineBinding(this, "selected", { - boundObject: this.data, - boundObjectPropertyPath: "selected", - oneway: false - }); - if(this.data.container) { this.element.title = this.data.subtools[this._subselected].toolTip; - Object.defineBinding(this, "subselected", { - boundObject: this.data.subtools, - boundObjectPropertyPath: "selected", - oneway: true - }); } this.element.classList.add(this.data.id) diff --git a/js/components/layout/tools-list.reel/tools-list.html b/js/components/layout/tools-list.reel/tools-list.html index d5c33624..df603bf8 100755 --- a/js/components/layout/tools-list.reel/tools-list.html +++ b/js/components/layout/tools-list.reel/tools-list.html @@ -16,11 +16,7 @@ "element": {"#": "toolbutton"} }, "bindings": { - "data": { - "boundObject": {"@": "repetition1"}, - "boundObjectPropertyPath": "objectAtCurrentIteration", - "oneway": true - } + "data": {"<-": "@repetition1.objectAtCurrentIteration"} } }, @@ -30,11 +26,7 @@ "element": {"#": "groupLine"} }, "bindings": { - "condition": { - "boundObject": {"@": "repetition1"}, - "boundObjectPropertyPath": "objectAtCurrentIteration.lastInGroup", - "oneway": true - } + "condition": {"<-": "@repetition1.objectAtCurrentIteration.lastInGroup"} } }, diff --git a/js/data/tools-data.js b/js/data/tools-data.js index 32eaf24d..05455efe 100755 --- a/js/data/tools-data.js +++ b/js/data/tools-data.js @@ -60,6 +60,7 @@ exports.ToolsData = Montage.create(Montage, { "cursor": "auto", "lastInGroup": false, "container": false, + "subtools": [], "selected": true }, { @@ -71,6 +72,7 @@ exports.ToolsData = Montage.create(Montage, { "cursor": "auto", "lastInGroup": false, "container": false, + "subtools": [], "selected": false }, { @@ -82,6 +84,7 @@ exports.ToolsData = Montage.create(Montage, { "cursor": "auto", "lastInGroup": true, "container": false, + "subtools": [], "selected": false }, { @@ -93,6 +96,7 @@ exports.ToolsData = Montage.create(Montage, { "cursor": "url('images/cursors/Crosshair.png') 8 8, default", "lastInGroup": false, "container": false, + "subtools": [], "selected": false }, { @@ -104,6 +108,7 @@ exports.ToolsData = Montage.create(Montage, { "cursor": "auto", "lastInGroup": false, "container": false, + "subtools": [], "selected": false }, { @@ -115,6 +120,7 @@ exports.ToolsData = Montage.create(Montage, { "cursor": "text", "lastInGroup": false, "container": false, + "subtools": [], "selected": false }, { @@ -163,6 +169,7 @@ exports.ToolsData = Montage.create(Montage, { "cursor": "url('images/tools/brush_down.png') 9 17, default", "lastInGroup": false, "container": false, + "subtools": [], "selected": false }, { @@ -174,6 +181,7 @@ exports.ToolsData = Montage.create(Montage, { "cursor": "url('images/tools/bucket_down.png'), default", "lastInGroup": false, "container": false, + "subtools": [], "selected": false }, { @@ -185,6 +193,7 @@ exports.ToolsData = Montage.create(Montage, { "cursor": "url('images/tools/inkbottle_cursor.png'), default", "lastInGroup": true, "container": false, + "subtools": [], "selected": false }, // { @@ -196,6 +205,7 @@ exports.ToolsData = Montage.create(Montage, { // "cursor": "auto", // "lastInGroup": false, // "container": false, +// "subtools": [], // "selected": false // }, { @@ -207,6 +217,7 @@ exports.ToolsData = Montage.create(Montage, { "cursor": "auto", "lastInGroup": false, "container": false, + "subtools": [], "selected": false }, { @@ -218,6 +229,7 @@ exports.ToolsData = Montage.create(Montage, { "cursor": "url('images/tools/hand_down.png'), default", "lastInGroup": false, "container": false, + "subtools": [], "selected": false }, { @@ -229,6 +241,7 @@ exports.ToolsData = Montage.create(Montage, { "cursor": "url('images/cursors/zoom.png'),default", "lastInGroup": true, "container": false, + "subtools": [], "selected": false } ] -- cgit v1.2.3 From e9dddef38507cafcf5702ce6a512b4005609acef Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 18 May 2012 01:14:41 -0700 Subject: Fixing the save as paths Signed-off-by: Valerio Virgillito --- js/controllers/document-controller.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js') diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index fc1f2c0f..ea4022b8 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js @@ -177,8 +177,8 @@ var DocumentController = exports.DocumentController = Montage.create(Component, value: function(event) { var saveAsSettings = event._event.settings || {}; if((typeof this.activeDocument !== "undefined") && this.application.ninja.coreIoApi.cloudAvailable()){ - saveAsSettings.fileName = this.activeDocument.name; - saveAsSettings.folderUri = this.activeDocument.uri.substring(0, this.activeDocument.uri.lastIndexOf("/")); + saveAsSettings.fileName = this.activeDocument.model.file.name; + saveAsSettings.folderUri = this.activeDocument.model.file.uri.substring(0, this.activeDocument.model.file.uri.lastIndexOf("/")); saveAsSettings.callback = this.saveAsCallback.bind(this); this.application.ninja.newFileController.showSaveAsDialog(saveAsSettings); } -- cgit v1.2.3 From 24d1873302b2fffc25d254e15e8aa36f59eedb88 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Fri, 18 May 2012 01:36:05 -0700 Subject: fixed a switch documents bug where the layout was getting called before setting the container. Signed-off-by: Valerio Virgillito --- js/controllers/document-controller.js | 4 +++- js/ninja.reel/ninja.js | 6 ++++-- js/stage/stage.reel/stage.js | 8 ++++++++ 3 files changed, 15 insertions(+), 3 deletions(-) (limited to 'js') diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index ea4022b8..f1523d87 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js @@ -492,6 +492,8 @@ var DocumentController = exports.DocumentController = Montage.create(Component, currentDocument.model.views.design.hide(); } + this.application.ninja.stage.clearAllCanvas(); + if(didCreate) { newDocument.model.views.design.iframe.style.opacity = 1; NJevent("onOpenDocument", newDocument); @@ -499,7 +501,7 @@ var DocumentController = exports.DocumentController = Montage.create(Component, this.activeDocument = newDocument; newDocument.model.views.design.show(); newDocument.deserializeDocument(); - NJevent("switchDocument"); + NJevent("onSwitchDocument"); } } }, diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index 067a005f..6d41cd53 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js @@ -175,7 +175,7 @@ exports.Ninja = Montage.create(Component, { this.eventManager.addEventListener("selectTool", this, false); this.eventManager.addEventListener("selectSubTool", this, false); this.eventManager.addEventListener("onOpenDocument", this, false); - this.eventManager.addEventListener("switchDocument", this, false); + this.eventManager.addEventListener("onSwitchDocument", this, false); this.addPropertyChangeListener("appModel.livePreview", this.executeLivePreview, false); this.addPropertyChangeListener("appModel.chromePreview", this.executeChromePreview, false); @@ -291,13 +291,15 @@ exports.Ninja = Montage.create(Component, { } }, - handleSwitchDocument: { + handleOnSwitchDocument: { value: function() { this.currentDocument = this.documentController.activeDocument; if(this.currentDocument.documentRoot) { this._currentSelectedContainer = this.selectionController._currentSelectedContainer = this.currentDocument.documentRoot; } + + NJevent("switchDocument"); } }, diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js index cac99326..8da89fb9 100755 --- a/js/stage/stage.reel/stage.js +++ b/js/stage/stage.reel/stage.js @@ -593,6 +593,14 @@ exports.Stage = Montage.create(Component, { } }, + clearAllCanvas: { + value: function() { + this._drawingContext.clearRect(0, 0, this._drawingCanvas.width, this._drawingCanvas.height); + this.context.clearRect(0, 0, this.canvas.width, this.canvas.height); + this.layout.clearCanvas(); + } + }, + SelectTool: { value: function(cursor) { this._drawingCanvas.style.cursor = cursor; -- cgit v1.2.3