From 0e6e40a835a73ba04156d579f5a0c900a9b5c4eb Mon Sep 17 00:00:00 2001 From: Jon Reid Date: Fri, 13 Apr 2012 14:45:08 -0700 Subject: Timeline: Bug fixes for restoring tweens on new document and breadcrumb. --- .../Timeline/TimelinePanel.reel/TimelinePanel.js | 28 ++++++++++------------ .../Timeline/TimelineTrack.reel/TimelineTrack.js | 3 ++- 2 files changed, 15 insertions(+), 16 deletions(-) (limited to 'js/panels') 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, { this.playhead.addEventListener("mousedown", this.startPlayheadTracking.bind(this), false); this.playhead.addEventListener("mouseup", this.stopPlayheadTracking.bind(this), false); this.time_markers.addEventListener("click", this.updatePlayhead.bind(this), false); + + // Initialize BreadCrumb + this.application.ninja.breadCrumbClick = false; this.enablePanel(false); } }, @@ -540,7 +543,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this.drawTimeMarkers(); // Document switching // Check to see if we have saved timeline information in the currentDocument. - if (typeof(this.application.ninja.currentDocument.isTimelineInitialized) === "undefined") { + if ((typeof(this.application.ninja.currentDocument.isTimelineInitialized) === "undefined") && + (!this.application.ninja.breadCrumbClick)) { // No, we have no information stored. // This could mean we are creating a new file, OR are opening an existing file. @@ -581,6 +585,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this.arrLayers = this.temparrLayers; this.currentLayerNumber = storedCurrentLayerNumber; this.currentLayerSelected = this.application.ninja.currentSelectedContainer; + // this.application.ninja.breadCrumbClick = false; } else { // we do have information stored. Use it. @@ -747,20 +752,13 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { value:function (node) { var i = 0; - if (typeof(this.application.ninja.currentDocument.isTimelineInitialized) === "undefined" || (this.application.ninja.breadCrumbClick)) { - if (this._firstTimeLoaded) { - this._firstTimeLoaded = false; - } else { - this._boolCacheArrays = false; - this.clearTimelinePanel(); - this._boolCacheArrays = true; - this._bindDocumentEvents(); - this.initTimelineForDocument(); - this.application.ninja.breadCrumbClick=false; - } - }else{ - this._firstTimeLoaded=false; - } + if (this._firstTimeLoaded === true) { + this._firstTimeLoaded = false; + return; + } + + this.handleDocumentChange(); + // this.application.ninja.breadCrumbClick=false; } }, 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, { didDraw:{ value:function () { - if (!this.application.ninja.documentController.creatingNewFile) { + if ((!this.application.ninja.documentController.creatingNewFile) || (this.application.ninja.breadCrumbClick)) { if (this.application.ninja.currentDocument.documentRoot.children[0]) { var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID); if (selectedIndex !== false) { if (!this.application.ninja.timeline.arrLayers[selectedIndex].layerData.created) { this.retrieveStoredTweens(); + this.application.ninja.breadCrumbClick = false; } } } -- cgit v1.2.3