diff options
Diffstat (limited to 'js/controllers/document-controller.js')
-rwxr-xr-x | js/controllers/document-controller.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index 588481bb..ee7ca82c 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 | } |
@@ -356,7 +356,7 @@ exports.DocumentController = Montage.create(Component, { | |||
356 | break; | 356 | break; |
357 | default: | 357 | default: |
358 | //Open in code view | 358 | //Open in code view |
359 | Montage.create(TextDocument).init(file, this.application.ninja, this.application.ninja.openDocument, 'code'); | 359 | Montage.create(TextDocument).init(file, this.application.ninja, this.application.ninja.openDocument, 'code', document.getElementById("codeViewContainer")); |
360 | break; | 360 | break; |
361 | } | 361 | } |
362 | } | 362 | } |