diff options
Diffstat (limited to 'js/stage/stage.reel')
-rwxr-xr-x | js/stage/stage.reel/stage.js | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js index 82c4d652..da5a4f76 100755 --- a/js/stage/stage.reel/stage.js +++ b/js/stage/stage.reel/stage.js | |||
@@ -164,27 +164,23 @@ exports.Stage = Montage.create(Component, { | |||
164 | return this._currentDocument; | 164 | return this._currentDocument; |
165 | }, | 165 | }, |
166 | set : function(value) { | 166 | set : function(value) { |
167 | // TODO: WRONG! Fails when going from design to code view | 167 | if (value === this._currentDocument) { |
168 | if (value === this._currentDocument || value.getProperty("currentView") !== "design") { | ||
169 | console.log("Stage - current document not set since the same value of " + this._currentDocument + " and value " + value); | ||
170 | return; | 168 | return; |
171 | } | 169 | } |
172 | 170 | ||
173 | if(!this._currentDocument) { | 171 | if(!this._currentDocument && value.currentView === "design") { |
174 | this.showRulers(); | 172 | this.showRulers(); |
175 | this.hideCanvas(false); | 173 | this.hideCanvas(false); |
176 | } | 174 | } |
177 | 175 | ||
178 | this._currentDocument = value; | 176 | this._currentDocument = value; |
179 | 177 | ||
180 | if(this._currentDocument.currentView === "design") { | ||
181 | this.clearAllCanvas(); | ||
182 | this.initWithDocument(false); | ||
183 | } | ||
184 | |||
185 | if(!value) { | 178 | if(!value) { |
186 | this.hideRulers(); | 179 | this.hideRulers(); |
187 | this.hideCanvas(true); | 180 | this.hideCanvas(true); |
181 | } else if(this._currentDocument.currentView === "design") { | ||
182 | this.clearAllCanvas(); | ||
183 | this.initWithDocument(false); | ||
188 | } | 184 | } |
189 | } | 185 | } |
190 | }, | 186 | }, |