aboutsummaryrefslogtreecommitdiff
path: root/js/controllers/document-controller.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/controllers/document-controller.js')
-rwxr-xr-xjs/controllers/document-controller.js16
1 files changed, 4 insertions, 12 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js
index 13ab33cc..c9557a57 100755
--- a/js/controllers/document-controller.js
+++ b/js/controllers/document-controller.js
@@ -53,9 +53,11 @@ exports.DocumentController = Montage.create(Component, {
53 document.getElementById("iframeContainer").style.display = "block"; 53 document.getElementById("iframeContainer").style.display = "block";
54 document.getElementById("codeViewContainer").style.display = "block"; 54 document.getElementById("codeViewContainer").style.display = "block";
55 } else if(this._currentDocument.currentView === "design") { 55 } else if(this._currentDocument.currentView === "design") {
56 56 this._currentDocument.model.currentView.show();
57 this._currentDocument.model.views.design._liveNodeList = this._currentDocument.model.documentRoot.getElementsByTagName('*');
57 } else { 58 } else {
58 document.getElementById("iframeContainer").style.display = "none"; 59 document.getElementById("iframeContainer").style.display = "none";
60 this._currentDocument.model.currentView.show();
59 } 61 }
60 62
61 } 63 }
@@ -354,14 +356,8 @@ exports.DocumentController = Montage.create(Component, {
354 if(currentDocument) { 356 if(currentDocument) {
355 if(currentDocument.currentView === "design") { 357 if(currentDocument.currentView === "design") {
356 currentDocument.serializeDocument(); 358 currentDocument.serializeDocument();
357 this.application.ninja._currentSelectedContainer = this.application.ninja.selectionController._selectionContainer = null;
358 currentDocument.model.views.design.propertiesPanel.clear();
359 } 359 }
360 360
361 currentDocument.model.isActive = false;
362
363 currentDocument.model.currentView.hide();
364
365 if(currentDocument.model.parentContainer !== newDocument.model.parentContainer) { 361 if(currentDocument.model.parentContainer !== newDocument.model.parentContainer) {
366 currentDocument.model.parentContainer.style["display"] = "none"; 362 currentDocument.model.parentContainer.style["display"] = "none";
367 newDocument.model.parentContainer.style["display"] = "block"; 363 newDocument.model.parentContainer.style["display"] = "block";
@@ -382,13 +378,9 @@ exports.DocumentController = Montage.create(Component, {
382 this.application.ninja.stage.hideRulers(); 378 this.application.ninja.stage.hideRulers();
383 } 379 }
384 380
385// this.application.ninja.stage.clearAllCanvas();
386
387 if(didCreate) { 381 if(didCreate) {
388// newDocument.model.currentView.show();
389
390 if(newDocument.currentView === "design") { 382 if(newDocument.currentView === "design") {
391 NJevent("onOpenDocument", newDocument); 383
392 } else { 384 } else {
393 newDocument.model.parentContainer.style["display"] = "block"; 385 newDocument.model.parentContainer.style["display"] = "block";
394 } 386 }