From 6307b0930f1a8452de954ae16e293da2f575db04 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Thu, 31 May 2012 14:49:41 -0700 Subject: removing the last closeDocument handler Signed-off-by: Valerio Virgillito --- js/controllers/document-controller.js | 10 ++++++---- js/helper-classes/3D/draw-utils.js | 10 ---------- js/stage/stage.reel/stage.js | 2 ++ 3 files changed, 8 insertions(+), 14 deletions(-) (limited to 'js') diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index f85e2f97..72a669b3 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js @@ -45,6 +45,11 @@ exports.DocumentController = Montage.create(Component, { if(this._currentDocument) { this._currentDocument.model.currentView.hide(); + + if(this._currentDocument.model.parentContainer !== value.model.parentContainer) { + this._currentDocument.model.parentContainer.style["display"] = "none"; + value.model.parentContainer.style["display"] = "block"; + } } this._currentDocument = value; @@ -355,10 +360,7 @@ exports.DocumentController = Montage.create(Component, { currentDocument.serializeDocument(); } - if(currentDocument.model.parentContainer !== newDocument.model.parentContainer) { - currentDocument.model.parentContainer.style["display"] = "none"; - newDocument.model.parentContainer.style["display"] = "block"; - } + if(currentDocument.currentView === "code" && newDocument.currentView === "design") { this.application.ninja.stage.showCodeViewBar(false); diff --git a/js/helper-classes/3D/draw-utils.js b/js/helper-classes/3D/draw-utils.js index c98ad8bc..a793b643 100755 --- a/js/helper-classes/3D/draw-utils.js +++ b/js/helper-classes/3D/draw-utils.js @@ -112,7 +112,6 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, { this.eventManager.addEventListener("elementsRemoved", this, false); this.eventManager.addEventListener("elementChange", this, false); this.eventManager.addEventListener("elementChanging", this, false); - this.eventManager.addEventListener("closeDocument", this, false); this.eventManager.addEventListener("elementReplaced", this, false); } }, @@ -164,15 +163,6 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, { } }, - handleCloseDocument:{ - value: function() { - if(this.application.ninja.documentController._documents.length === 0){ - this._eltArray.length = 0; - this._planesArray.length = 0; - } - } - }, - handleElementAdded: { value: function(event) { var elements = event.detail; diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js index dc00eac2..4c4ba6c9 100755 --- a/js/stage/stage.reel/stage.js +++ b/js/stage/stage.reel/stage.js @@ -184,6 +184,8 @@ exports.Stage = Montage.create(Component, { if(!value) { this.hideRulers(); this.hideCanvas(true); + drawUtils._eltArray.length = 0; + drawUtils._planesArray.length = 0; } else if(this._currentDocument.currentView === "design") { this.clearAllCanvas(); this.initWithDocument(false); -- cgit v1.2.3