aboutsummaryrefslogtreecommitdiff
path: root/js/controllers
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-07-16 14:50:50 -0700
committerJose Antonio Marquez2012-07-16 14:50:50 -0700
commita402ae19732f7aeb53de27e3f25f72e9c42a453c (patch)
tree50deead3fd1264d70a98e202197b7f282c9af4be /js/controllers
parentcdaeb7e05e4d59832b9896f6995e0163e3decf50 (diff)
downloadninja-a402ae19732f7aeb53de27e3f25f72e9c42a453c.tar.gz
New: Added switching view functionality to document UI
This now let's you switch between code and design views in all documents opened that support design view. Code view for these documents is currently unsupported, so this is just to hook up the UI to the new methods. Code view will be added next.
Diffstat (limited to 'js/controllers')
-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 }