aboutsummaryrefslogtreecommitdiff
path: root/js/stage
diff options
context:
space:
mode:
authorJose Antonio Marquez Russo2012-07-25 07:52:19 -0700
committerJose Antonio Marquez Russo2012-07-25 07:52:19 -0700
commitbb2f1d0e9a559f44348e95ad726801a5031aea3a (patch)
treea73b1dbc93fd8cba24bc97475905d182d90a1d6b /js/stage
parentc127d66ed02d61e281ce931a6caecfdcef7f2999 (diff)
parent1fae8b14621970680ca51c2a4a5f4f8006e1aee2 (diff)
downloadninja-bb2f1d0e9a559f44348e95ad726801a5031aea3a.tar.gz
Merge pull request #46 from mencio/document-switch
design/code view switching for stage and menu
Diffstat (limited to 'js/stage')
-rwxr-xr-xjs/stage/stage.reel/stage.js13
1 files changed, 11 insertions, 2 deletions
diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js
index 39336b57..883f1526 100755
--- a/js/stage/stage.reel/stage.js
+++ b/js/stage/stage.reel/stage.js
@@ -349,6 +349,9 @@ exports.Stage = Montage.create(Component, {
349 349
350 //call configure false with the old document on the selected tool to tear down down any temp. stuff 350 //call configure false with the old document on the selected tool to tear down down any temp. stuff
351 this.application.ninja.toolsData.selectedToolInstance._configure(false); 351 this.application.ninja.toolsData.selectedToolInstance._configure(false);
352
353 // Remove the change listener
354 this._currentDocument.removePropertyChangeListener("model.currentViewIdentifier", this, false);
352 } else if(this.currentDocument && (this.currentDocument.currentView === "code")) { 355 } else if(this.currentDocument && (this.currentDocument.currentView === "code")) {
353 this.switchedFromCodeDoc = true; // Switching from code document affects stage's size and scrollbar 356 this.switchedFromCodeDoc = true; // Switching from code document affects stage's size and scrollbar
354 } 357 }
@@ -369,7 +372,7 @@ exports.Stage = Montage.create(Component, {
369 this.clearAllCanvas(); 372 this.clearAllCanvas();
370 this.initWithDocument(); 373 this.initWithDocument();
371 374
372 this._currentDocument.addPropertyChangeListener("model.currentView", this, false); 375 this._currentDocument.addPropertyChangeListener("model.currentViewIdentifier", this, false);
373 } else { 376 } else {
374 this.collapseAllPanels(); 377 this.collapseAllPanels();
375 this.hideCanvas(true); 378 this.hideCanvas(true);
@@ -381,6 +384,9 @@ exports.Stage = Montage.create(Component, {
381 handleDocumentViewChange: { 384 handleDocumentViewChange: {
382 value: function() { 385 value: function() {
383 if(this.currentDocument.model.currentView.identifier === "design-code") { 386 if(this.currentDocument.model.currentView.identifier === "design-code") {
387 drawUtils._eltArray.length = 0;
388 drawUtils._planesArray.length = 0;
389
384 this.collapseAllPanels(); 390 this.collapseAllPanels();
385 this.hideRulers(); 391 this.hideRulers();
386 this.hideCanvas(true); 392 this.hideCanvas(true);
@@ -388,6 +394,9 @@ exports.Stage = Montage.create(Component, {
388 this.restoreAllPanels(true); 394 this.restoreAllPanels(true);
389 this.hideCanvas(false); 395 this.hideCanvas(false);
390 this.showRulers(); 396 this.showRulers();
397
398 this.clearAllCanvas();
399 this.initWithDocument();
391 } 400 }
392 } 401 }
393 }, 402 },
@@ -600,7 +609,7 @@ exports.Stage = Montage.create(Component, {
600 drawUtils.drawXZ = false; 609 drawUtils.drawXZ = false;
601 this.updatedStage = true; 610 this.updatedStage = true;
602 } 611 }
603 } else if(notification.currentPropertyPath === "model.currentView") { 612 } else if(notification.currentPropertyPath === "model.currentViewIdentifier") {
604 this.handleDocumentViewChange(); 613 this.handleDocumentViewChange();
605 } 614 }
606 /* 615 /*