diff options
author | Jose Antonio Marquez Russo | 2012-07-24 17:15:30 -0700 |
---|---|---|
committer | Jose Antonio Marquez Russo | 2012-07-24 17:15:30 -0700 |
commit | 98b098942d0f0c46d645879972e1cd47a09436d5 (patch) | |
tree | c350756f9295835bdf39e8d3afc2178ed67ec649 /js/controllers/document-controller.js | |
parent | 3ec902504a7188b6468d93e9ec194bb97af6222f (diff) | |
parent | 80ff3adb07eff80e30a073d578b6273bd515bb4e (diff) | |
download | ninja-98b098942d0f0c46d645879972e1cd47a09436d5.tar.gz |
Merge pull request #45 from mencio/document-switch
Document switch fixes
Diffstat (limited to 'js/controllers/document-controller.js')
-rwxr-xr-x | js/controllers/document-controller.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index ee7ca82c..83c1f58c 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js | |||
@@ -80,6 +80,7 @@ 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.addPropertyChangeListener("model.currentViewIdentifier", this, false); | ||
83 | if (this._currentDocument.model.currentView) this._currentDocument.model.currentView.show(); | 84 | if (this._currentDocument.model.currentView) this._currentDocument.model.currentView.show(); |
84 | this._currentDocument.model.views.design._liveNodeList = this._currentDocument.model.documentRoot.getElementsByTagName('*'); | 85 | this._currentDocument.model.views.design._liveNodeList = this._currentDocument.model.documentRoot.getElementsByTagName('*'); |
85 | } else { | 86 | } else { |
@@ -91,6 +92,23 @@ exports.DocumentController = Montage.create(Component, { | |||
91 | } | 92 | } |
92 | }, | 93 | }, |
93 | 94 | ||
95 | handleChange: { | ||
96 | value: function(notification) { | ||
97 | if(notification.currentPropertyPath === "model.currentViewIdentifier") { | ||
98 | if(this.currentDocument.model.currentView.identifier === "design-code") { | ||
99 | // document.getElementById("iframeContainer").style.display = "none"; | ||
100 | // this._currentDocument.model.parentContainer.style["display"] = "block"; | ||
101 | // if (this._currentDocument.model.currentView) this._currentDocument.model.currentView.show(); | ||
102 | } else { | ||
103 | document.getElementById("codeViewContainer").style.display = "none"; | ||
104 | document.getElementById("iframeContainer").style.display = "block"; | ||
105 | if (this._currentDocument.model.currentView) this._currentDocument.model.currentView.show(); | ||
106 | this._currentDocument.model.views.design._liveNodeList = this._currentDocument.model.documentRoot.getElementsByTagName('*'); | ||
107 | } | ||
108 | } | ||
109 | } | ||
110 | }, | ||
111 | |||
94 | deserializedFromTemplate: { | 112 | deserializedFromTemplate: { |
95 | value: function() { //TODO: Add event naming consistency (save, fileOpen and newFile should be consistent, all file events should be executeFile[operation name]) | 113 | value: function() { //TODO: Add event naming consistency (save, fileOpen and newFile should be consistent, all file events should be executeFile[operation name]) |
96 | this.eventManager.addEventListener("appLoaded", this, false); | 114 | this.eventManager.addEventListener("appLoaded", this, false); |