aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rwxr-xr-xjs/controllers/document-controller.js10
-rwxr-xr-xjs/helper-classes/3D/draw-utils.js10
-rwxr-xr-xjs/stage/stage.reel/stage.js2
3 files changed, 8 insertions, 14 deletions
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, {
45 45
46 if(this._currentDocument) { 46 if(this._currentDocument) {
47 this._currentDocument.model.currentView.hide(); 47 this._currentDocument.model.currentView.hide();
48
49 if(this._currentDocument.model.parentContainer !== value.model.parentContainer) {
50 this._currentDocument.model.parentContainer.style["display"] = "none";
51 value.model.parentContainer.style["display"] = "block";
52 }
48 } 53 }
49 54
50 this._currentDocument = value; 55 this._currentDocument = value;
@@ -355,10 +360,7 @@ exports.DocumentController = Montage.create(Component, {
355 currentDocument.serializeDocument(); 360 currentDocument.serializeDocument();
356 } 361 }
357 362
358 if(currentDocument.model.parentContainer !== newDocument.model.parentContainer) { 363
359 currentDocument.model.parentContainer.style["display"] = "none";
360 newDocument.model.parentContainer.style["display"] = "block";
361 }
362 364
363 if(currentDocument.currentView === "code" && newDocument.currentView === "design") { 365 if(currentDocument.currentView === "code" && newDocument.currentView === "design") {
364 this.application.ninja.stage.showCodeViewBar(false); 366 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, {
112 this.eventManager.addEventListener("elementsRemoved", this, false); 112 this.eventManager.addEventListener("elementsRemoved", this, false);
113 this.eventManager.addEventListener("elementChange", this, false); 113 this.eventManager.addEventListener("elementChange", this, false);
114 this.eventManager.addEventListener("elementChanging", this, false); 114 this.eventManager.addEventListener("elementChanging", this, false);
115 this.eventManager.addEventListener("closeDocument", this, false);
116 this.eventManager.addEventListener("elementReplaced", this, false); 115 this.eventManager.addEventListener("elementReplaced", this, false);
117 } 116 }
118 }, 117 },
@@ -164,15 +163,6 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
164 } 163 }
165 }, 164 },
166 165
167 handleCloseDocument:{
168 value: function() {
169 if(this.application.ninja.documentController._documents.length === 0){
170 this._eltArray.length = 0;
171 this._planesArray.length = 0;
172 }
173 }
174 },
175
176 handleElementAdded: { 166 handleElementAdded: {
177 value: function(event) { 167 value: function(event) {
178 var elements = event.detail; 168 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, {
184 if(!value) { 184 if(!value) {
185 this.hideRulers(); 185 this.hideRulers();
186 this.hideCanvas(true); 186 this.hideCanvas(true);
187 drawUtils._eltArray.length = 0;
188 drawUtils._planesArray.length = 0;
187 } else if(this._currentDocument.currentView === "design") { 189 } else if(this._currentDocument.currentView === "design") {
188 this.clearAllCanvas(); 190 this.clearAllCanvas();
189 this.initWithDocument(false); 191 this.initWithDocument(false);