aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-06-25 14:54:16 -0700
committerNivesh Rajbhandari2012-06-25 14:54:16 -0700
commit48bb94a72126e7be712b2c4ca9be2f03ecb65aea (patch)
treeb6af0b0e104e02ea3f21354a5569b9eb5857886f /js
parentd2e88bb251efb29f13911942f1f91101715c727e (diff)
downloadninja-48bb94a72126e7be712b2c4ca9be2f03ecb65aea.tar.gz
IKNinja-1688 - Creating a banner file after a code file causes body div to shift to the right and has different scroll bars.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js')
-rwxr-xr-xjs/panels/Splitter.js8
-rwxr-xr-xjs/stage/stage.reel/stage.js16
2 files changed, 16 insertions, 8 deletions
diff --git a/js/panels/Splitter.js b/js/panels/Splitter.js
index c6d46911..4f2a137e 100755
--- a/js/panels/Splitter.js
+++ b/js/panels/Splitter.js
@@ -156,7 +156,7 @@ exports.Splitter = Montage.create(Component, {
156 } 156 }
157 }, 157 },
158 restore:{ 158 restore:{
159 value: function() { 159 value: function(onSwitchFromCodeDocument) {
160 //Get splitter initial value from SettingManager 160 //Get splitter initial value from SettingManager
161 var storedData = this.application.localStorage.getItem(this.element.getAttribute("data-montage-id")), temp = this.collapsed; 161 var storedData = this.application.localStorage.getItem(this.element.getAttribute("data-montage-id")), temp = this.collapsed;
162 if(storedData && this.element.getAttribute("data-montage-id") !== null) { 162 if(storedData && this.element.getAttribute("data-montage-id") !== null) {
@@ -172,7 +172,11 @@ exports.Splitter = Montage.create(Component, {
172 this.panel.addEventListener("webkitTransitionEnd", this, false); 172 this.panel.addEventListener("webkitTransitionEnd", this, false);
173 } 173 }
174 this.disabled = false; 174 this.disabled = false;
175 this.needsDraw = true; 175 if(onSwitchFromCodeDocument) {
176 this.draw(); // When switching from code document, draw immediately so stage size is correct
177 } else {
178 this.needsDraw = true;
179 }
176 } 180 }
177 } 181 }
178 } 182 }
diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js
index 5e913c76..319ffe87 100755
--- a/js/stage/stage.reel/stage.js
+++ b/js/stage/stage.reel/stage.js
@@ -19,6 +19,7 @@ exports.Stage = Montage.create(Component, {
19 // TODO - Need to figure out how to remove this dependency 19 // TODO - Need to figure out how to remove this dependency
20 // Needed by some tools that depend on selectionDrawn event to set up some logic 20 // Needed by some tools that depend on selectionDrawn event to set up some logic
21 drawNow: { value : false }, 21 drawNow: { value : false },
22 switchedFromCodeDoc: { value : false },
22 23
23 // TO REVIEW 24 // TO REVIEW
24 zoomFactor: {value : 1 }, 25 zoomFactor: {value : 1 },
@@ -256,6 +257,8 @@ exports.Stage = Montage.create(Component, {
256 257
257 //call configure false with the old document on the selected tool to tear down down any temp. stuff 258 //call configure false with the old document on the selected tool to tear down down any temp. stuff
258 this.application.ninja.toolsData.selectedToolInstance._configure(false); 259 this.application.ninja.toolsData.selectedToolInstance._configure(false);
260 } else if(this.currentDocument && (this.currentDocument.currentView === "code")) {
261 this.switchedFromCodeDoc = true; // Switching from code document affects stage's size and scrollbar
259 } 262 }
260 263
261 this._currentDocument = value; 264 this._currentDocument = value;
@@ -266,7 +269,8 @@ exports.Stage = Montage.create(Component, {
266 drawUtils._eltArray.length = 0; 269 drawUtils._eltArray.length = 0;
267 drawUtils._planesArray.length = 0; 270 drawUtils._planesArray.length = 0;
268 } else if(this._currentDocument.currentView === "design") { 271 } else if(this._currentDocument.currentView === "design") {
269 this.restoreAllPanels(); 272 this.restoreAllPanels(this.switchedFromCodeDoc);
273 this.switchedFromCodeDoc = false;
270 this.hideCanvas(false); 274 this.hideCanvas(false);
271 this.showRulers(); 275 this.showRulers();
272 276
@@ -1271,11 +1275,11 @@ exports.Stage = Montage.create(Component, {
1271 } 1275 }
1272 }, 1276 },
1273 restoreAllPanels:{ 1277 restoreAllPanels:{
1274 value:function(){ 1278 value:function(onSwitchDocument){
1275 this.application.ninja.panelSplitter.restore(); 1279 this.application.ninja.panelSplitter.restore(onSwitchDocument);
1276 this.application.ninja.timelineSplitter.restore(); 1280 this.application.ninja.timelineSplitter.restore(onSwitchDocument);
1277 this.application.ninja.toolsSplitter.restore(); 1281 this.application.ninja.toolsSplitter.restore(onSwitchDocument);
1278 this.application.ninja.optionsSplitter.restore(); 1282 this.application.ninja.optionsSplitter.restore(onSwitchDocument);
1279 } 1283 }
1280 }, 1284 },
1281 1285