aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJon Reid2012-04-13 14:45:08 -0700
committerJon Reid2012-04-13 14:45:08 -0700
commit0e6e40a835a73ba04156d579f5a0c900a9b5c4eb (patch)
treed725649d7630420d1025215e4d7a86c91038f1e0 /js
parent96f78dec0e8ddd9ad975ec8150733f4945ff9095 (diff)
downloadninja-0e6e40a835a73ba04156d579f5a0c900a9b5c4eb.tar.gz
Timeline: Bug fixes for restoring tweens on new document and breadcrumb.
Diffstat (limited to 'js')
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js28
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js3
2 files changed, 15 insertions, 16 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index f0d08fe1..89d5e258 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -528,6 +528,9 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
528 this.playhead.addEventListener("mousedown", this.startPlayheadTracking.bind(this), false); 528 this.playhead.addEventListener("mousedown", this.startPlayheadTracking.bind(this), false);
529 this.playhead.addEventListener("mouseup", this.stopPlayheadTracking.bind(this), false); 529 this.playhead.addEventListener("mouseup", this.stopPlayheadTracking.bind(this), false);
530 this.time_markers.addEventListener("click", this.updatePlayhead.bind(this), false); 530 this.time_markers.addEventListener("click", this.updatePlayhead.bind(this), false);
531
532 // Initialize BreadCrumb
533 this.application.ninja.breadCrumbClick = false;
531 this.enablePanel(false); 534 this.enablePanel(false);
532 } 535 }
533 }, 536 },
@@ -540,7 +543,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
540 this.drawTimeMarkers(); 543 this.drawTimeMarkers();
541 // Document switching 544 // Document switching
542 // Check to see if we have saved timeline information in the currentDocument. 545 // Check to see if we have saved timeline information in the currentDocument.
543 if (typeof(this.application.ninja.currentDocument.isTimelineInitialized) === "undefined") { 546 if ((typeof(this.application.ninja.currentDocument.isTimelineInitialized) === "undefined") &&
547 (!this.application.ninja.breadCrumbClick)) {
544 // No, we have no information stored. 548 // No, we have no information stored.
545 // This could mean we are creating a new file, OR are opening an existing file. 549 // This could mean we are creating a new file, OR are opening an existing file.
546 550
@@ -581,6 +585,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
581 this.arrLayers = this.temparrLayers; 585 this.arrLayers = this.temparrLayers;
582 this.currentLayerNumber = storedCurrentLayerNumber; 586 this.currentLayerNumber = storedCurrentLayerNumber;
583 this.currentLayerSelected = this.application.ninja.currentSelectedContainer; 587 this.currentLayerSelected = this.application.ninja.currentSelectedContainer;
588 // this.application.ninja.breadCrumbClick = false;
584 589
585 } else { 590 } else {
586 // we do have information stored. Use it. 591 // we do have information stored. Use it.
@@ -747,20 +752,13 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
747 value:function (node) { 752 value:function (node) {
748 var i = 0; 753 var i = 0;
749 754
750 if (typeof(this.application.ninja.currentDocument.isTimelineInitialized) === "undefined" || (this.application.ninja.breadCrumbClick)) { 755 if (this._firstTimeLoaded === true) {
751 if (this._firstTimeLoaded) { 756 this._firstTimeLoaded = false;
752 this._firstTimeLoaded = false; 757 return;
753 } else { 758 }
754 this._boolCacheArrays = false; 759
755 this.clearTimelinePanel(); 760 this.handleDocumentChange();
756 this._boolCacheArrays = true; 761 // this.application.ninja.breadCrumbClick=false;
757 this._bindDocumentEvents();
758 this.initTimelineForDocument();
759 this.application.ninja.breadCrumbClick=false;
760 }
761 }else{
762 this._firstTimeLoaded=false;
763 }
764 } 762 }
765 }, 763 },
766 764
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
index 64ac08d3..87fd8282 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
@@ -469,12 +469,13 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
469 469
470 didDraw:{ 470 didDraw:{
471 value:function () { 471 value:function () {
472 if (!this.application.ninja.documentController.creatingNewFile) { 472 if ((!this.application.ninja.documentController.creatingNewFile) || (this.application.ninja.breadCrumbClick)) {
473 if (this.application.ninja.currentDocument.documentRoot.children[0]) { 473 if (this.application.ninja.currentDocument.documentRoot.children[0]) {
474 var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID); 474 var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID);
475 if (selectedIndex !== false) { 475 if (selectedIndex !== false) {
476 if (!this.application.ninja.timeline.arrLayers[selectedIndex].layerData.created) { 476 if (!this.application.ninja.timeline.arrLayers[selectedIndex].layerData.created) {
477 this.retrieveStoredTweens(); 477 this.retrieveStoredTweens();
478 this.application.ninja.breadCrumbClick = false;
478 } 479 }
479 } 480 }
480 } 481 }