diff options
Diffstat (limited to 'js/stage/stage.reel')
-rwxr-xr-x | js/stage/stage.reel/stage.html | 18 | ||||
-rwxr-xr-x | js/stage/stage.reel/stage.js | 35 |
2 files changed, 29 insertions, 24 deletions
diff --git a/js/stage/stage.reel/stage.html b/js/stage/stage.reel/stage.html index a819fc79..1b5cec17 100755 --- a/js/stage/stage.reel/stage.html +++ b/js/stage/stage.reel/stage.html | |||
@@ -18,25 +18,25 @@ | |||
18 | } | 18 | } |
19 | }, | 19 | }, |
20 | 20 | ||
21 | "StageDeps1": { | 21 | "stageDeps": { |
22 | "prototype": "js/stage/stage-deps", | 22 | "prototype": "js/stage/stage-deps", |
23 | "properties": { | 23 | "properties": { |
24 | "stage": {"@": "owner"} | 24 | "stage": {"@": "owner"} |
25 | }, | ||
26 | "bindings": { | ||
27 | "currentDocument": {"<-": "@owner.currentDocument"} | ||
25 | } | 28 | } |
26 | }, | 29 | }, |
27 | 30 | ||
28 | "layout1": { | 31 | "layout": { |
29 | "prototype": "js/stage/layout", | 32 | "prototype": "js/stage/layout", |
30 | "properties": { | 33 | "properties": { |
31 | "canvas": {"#": "layoutCanvas"}, | 34 | "canvas": {"#": "layoutCanvas"}, |
32 | "stage": {"@": "owner"} | 35 | "stage": {"@": "owner"} |
33 | }, | 36 | }, |
34 | "bindings": { | 37 | "bindings": { |
35 | "layoutView": { | 38 | "layoutView": {"<-": "@owner.appModel.layoutView"}, |
36 | "boundObject": {"@": "owner" }, | 39 | "currentDocument": {"<-": "@owner.currentDocument"} |
37 | "boundObjectPropertyPath": "appModel.layoutView", | ||
38 | "oneway": true | ||
39 | } | ||
40 | } | 40 | } |
41 | }, | 41 | }, |
42 | 42 | ||
@@ -60,8 +60,8 @@ | |||
60 | "_gridCanvas": {"#": "gridCanvas"}, | 60 | "_gridCanvas": {"#": "gridCanvas"}, |
61 | "_canvas": {"#": "stageCanvas"}, | 61 | "_canvas": {"#": "stageCanvas"}, |
62 | "_drawingCanvas": {"#": "drawingCanvas"}, | 62 | "_drawingCanvas": {"#": "drawingCanvas"}, |
63 | "stageDeps": {"@": "StageDeps1"}, | 63 | "stageDeps": {"@": "stageDeps"}, |
64 | "layout": {"@": "layout1"}, | 64 | "layout": {"@": "layout"}, |
65 | "stageView": {"@": "stageView"}, | 65 | "stageView": {"@": "stageView"}, |
66 | "textTool": {"@": "textTool"}, | 66 | "textTool": {"@": "textTool"}, |
67 | "focusManager": {"@": "focusManager"} | 67 | "focusManager": {"@": "focusManager"} |
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; |