From 57a0ca060f34297923e2e891ee25e5c928c09f00 Mon Sep 17 00:00:00 2001 From: Jon Reid Date: Thu, 19 Apr 2012 16:35:05 -0700 Subject: Timeline: More bug fixes for selection with multiple documents opening and closing. --- js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js') diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index a2f19b28..92c0766b 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -26,7 +26,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { return this._arrLayers; }, set:function (newVal) { -// debugger; this._arrLayers = newVal; this.needsDraw = true; this.cacheTimeline(); @@ -113,8 +112,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { var selectIndex = this.getLayerIndexByID(newVal); this._selectedLayerID = newVal; this._captureSelection = true; - //console.log(selectIndex); - //debugger; this.selectLayer(selectIndex, true); } } @@ -386,10 +383,10 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { returnObj.layerData.tweens = []; returnObj.layerData.layerTag = ""; returnObj.layerData.isVisible = true; + returnObj.layerData.docUUID = this.application.ninja.currentDocument._uuid; returnObj.layerData.isTrackAnimated = false; returnObj.parentElementUUID = null; returnObj.parentElement = null; - returnObj.docUUID = this.application.ninja.currentDocument._uuid; return returnObj; } @@ -525,6 +522,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this.drawTimeMarkers(); // Document switching // Check to see if we have saved timeline information in the currentDocument. + //debugger; if ((typeof(this.application.ninja.currentDocument.isTimelineInitialized) === "undefined") && (!this.application.ninja.currentDocument.breadCrumbClick)) { //console.log('TimelinePanel.initTimelineForDocument: new Document'); @@ -581,7 +579,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { // We're reading from the cache, not writing to it. this._boolCacheArrays = false; - for (i = 0; i < tlArrLayersLength; i++) { if (this.application.ninja.currentDocument.tlArrLayers[i].layerData.isSelected === true) { this.application.ninja.currentDocument.tlArrLayers[i].layerData._isFirstDraw = true; @@ -675,11 +672,16 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { handleBreadCrumbBinding:{ value:function(event){ + // Might fire if currentDocument has not yet been initialized. if (this.application.ninja.currentDocument == null) { return; } - if((typeof(this.application.ninja.currentDocument.isTimelineInitialized) === "undefined")) - return; + // Might fire if currentDocument is initialized but cache has not been initialized + if(typeof(this.application.ninja.currentDocument.isTimelineInitialized) === "undefined") { + return; + } + + // If the breadCrumb has been clicked, we need to change documents. if(this.application.ninja.currentDocument.breadCrumbClick){ this.handleDocumentChange(event); } @@ -1040,7 +1042,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this.layerRepetition.selectedIndexes = [layerIndex]; this.currentLayerSelected = this.arrLayers[layerIndex]; - if (userSelection) { if (this._captureSelection) { -- cgit v1.2.3