aboutsummaryrefslogtreecommitdiff
path: root/js/stage/stage.reel/stage.js
diff options
context:
space:
mode:
authorValerio Virgillito2012-05-30 01:33:20 -0700
committerValerio Virgillito2012-05-30 01:33:20 -0700
commit31b094ee21102f99a4021d505bc3a28527c9e23d (patch)
treea9525ea312f8cc0d25ab6410394f01e974b69068 /js/stage/stage.reel/stage.js
parentd8840eda0d3b3e31fb5a72306fe66608f4f99c2b (diff)
downloadninja-31b094ee21102f99a4021d505bc3a28527c9e23d.tar.gz
Fixing the close document.
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/stage/stage.reel/stage.js')
-rwxr-xr-xjs/stage/stage.reel/stage.js14
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 },