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.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js
index 588481bb..5020e27d 100755
--- a/js/controllers/document-controller.js
+++ b/js/controllers/document-controller.js
@@ -68,7 +68,7 @@ exports.DocumentController = Montage.create(Component, {
68 return; 68 return;
69 } 69 }
70 70
71 if(this._currentDocument) { 71 if(this._currentDocument && this._currentDocument.model.currentView) {
72 this._currentDocument.model.currentView.hide(); 72 this._currentDocument.model.currentView.hide();
73 } 73 }
74 74
@@ -80,12 +80,12 @@ exports.DocumentController = Montage.create(Component, {
80 } else if(this._currentDocument.currentView === "design") { 80 } else if(this._currentDocument.currentView === "design") {
81 document.getElementById("codeViewContainer").style.display = "none"; 81 document.getElementById("codeViewContainer").style.display = "none";
82 document.getElementById("iframeContainer").style.display = "block"; 82 document.getElementById("iframeContainer").style.display = "block";
83 this._currentDocument.model.currentView.show(); 83 if (this._currentDocument.model.currentView) this._currentDocument.model.currentView.show();
84 this._currentDocument.model.views.design._liveNodeList = this._currentDocument.model.documentRoot.getElementsByTagName('*'); 84 this._currentDocument.model.views.design._liveNodeList = this._currentDocument.model.documentRoot.getElementsByTagName('*');
85 } else { 85 } else {
86 document.getElementById("iframeContainer").style.display = "none"; 86 document.getElementById("iframeContainer").style.display = "none";
87 this._currentDocument.model.parentContainer.style["display"] = "block"; 87 this._currentDocument.model.parentContainer.style["display"] = "block";
88 this._currentDocument.model.currentView.show(); 88 if (this._currentDocument.model.currentView) this._currentDocument.model.currentView.show();
89 } 89 }
90 90
91 } 91 }