aboutsummaryrefslogtreecommitdiff
path: root/js/stage/stage.reel/stage.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/stage/stage.reel/stage.js')
-rwxr-xr-xjs/stage/stage.reel/stage.js35
1 files changed, 20 insertions, 15 deletions
diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js
index 7025c692..4505ff66 100755
--- a/js/stage/stage.reel/stage.js
+++ b/js/stage/stage.reel/stage.js
@@ -161,28 +161,35 @@ exports.Stage = Montage.create(Component, {
161 set: function(value) { this._userContentBorder = value; } 161 set: function(value) { this._userContentBorder = value; }
162 }, 162 },
163 163
164 _activeDocument : { 164 _currentDocument: {
165 value : null, 165 value : null
166 enumerable : false
167 }, 166 },
168 167
169 activeDocument : { 168 currentDocument : {
170 get : function() { 169 get : function() {
171 return this._activeDocument; 170 return this._currentDocument;
172 }, 171 },
173 set : function(document) { 172 set : function(value) {
174 ///// If the document is null set default stylesheets to null 173 if (value === this._currentDocument) {
174 return;
175 }
175 176
176 if(!document) { 177 if(!this._currentDocument && value.currentView === "design") {
177 return false; 178 this.showRulers();
179 this.hideCanvas(false);
178 } 180 }
179 181
180 ///// setting document via binding 182 this._currentDocument = value;
181 this._activeDocument = document;
182 183
184 if(!value) {
185 this.hideRulers();
186 this.hideCanvas(true);
187 } else if(this._currentDocument.currentView === "design") {
188 this.clearAllCanvas();
189 this.initWithDocument(false);
190 }
191 }
183 }, 192 },
184 enumerable : false
185 },
186 193
187 _userPaddingLeft: { value: 0 }, 194 _userPaddingLeft: { value: 0 },
188 _userPaddingTop: { value: 0 }, 195 _userPaddingTop: { value: 0 },
@@ -283,8 +290,6 @@ exports.Stage = Montage.create(Component, {
283 value: function(didSwitch) { 290 value: function(didSwitch) {
284 var designView = this.application.ninja.currentDocument.model.views.design; 291 var designView = this.application.ninja.currentDocument.model.views.design;
285 292
286 this.hideCanvas(false);
287
288 // Recalculate the canvas sizes because of splitter resizing 293 // Recalculate the canvas sizes because of splitter resizing
289 this._canvas.width = this._layoutCanvas.width = this._drawingCanvas.width = this._gridCanvas.width = this.element.offsetWidth - 11 ; 294 this._canvas.width = this._layoutCanvas.width = this._drawingCanvas.width = this._gridCanvas.width = this.element.offsetWidth - 11 ;
290 this._canvas.height = this._layoutCanvas.height = this._drawingCanvas.height = this._gridCanvas.height = this.element.offsetHeight - 11; 295 this._canvas.height = this._layoutCanvas.height = this._drawingCanvas.height = this._gridCanvas.height = this.element.offsetHeight - 11;