diff options
author | Jonathan Duran | 2012-04-20 07:54:39 -0700 |
---|---|---|
committer | Jonathan Duran | 2012-04-20 07:54:39 -0700 |
commit | 92791b40eed712aa6e341fc303b0d2ab19940777 (patch) | |
tree | 26d48632a13686ff3895ba63998d169783d0ffae /js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | |
parent | 2e27ce188f77ea1d4ef8a9c08bc853179c3f7c8b (diff) | |
parent | 57a0ca060f34297923e2e891ee25e5c928c09f00 (diff) | |
download | ninja-92791b40eed712aa6e341fc303b0d2ab19940777.tar.gz |
Merge branch 'refs/heads/timeline-local' into TimelineUber
Diffstat (limited to 'js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js')
-rw-r--r-- | js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 7fb57396..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, { | |||
26 | return this._arrLayers; | 26 | return this._arrLayers; |
27 | }, | 27 | }, |
28 | set:function (newVal) { | 28 | set:function (newVal) { |
29 | // debugger; | ||
30 | this._arrLayers = newVal; | 29 | this._arrLayers = newVal; |
31 | this.needsDraw = true; | 30 | this.needsDraw = true; |
32 | this.cacheTimeline(); | 31 | this.cacheTimeline(); |
@@ -113,7 +112,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
113 | var selectIndex = this.getLayerIndexByID(newVal); | 112 | var selectIndex = this.getLayerIndexByID(newVal); |
114 | this._selectedLayerID = newVal; | 113 | this._selectedLayerID = newVal; |
115 | this._captureSelection = true; | 114 | this._captureSelection = true; |
116 | this.selectLayer(selectIndex); | 115 | this.selectLayer(selectIndex, true); |
117 | } | 116 | } |
118 | } | 117 | } |
119 | }, | 118 | }, |
@@ -384,6 +383,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
384 | returnObj.layerData.tweens = []; | 383 | returnObj.layerData.tweens = []; |
385 | returnObj.layerData.layerTag = ""; | 384 | returnObj.layerData.layerTag = ""; |
386 | returnObj.layerData.isVisible = true; | 385 | returnObj.layerData.isVisible = true; |
386 | returnObj.layerData.docUUID = this.application.ninja.currentDocument._uuid; | ||
387 | returnObj.layerData.isTrackAnimated = false; | 387 | returnObj.layerData.isTrackAnimated = false; |
388 | returnObj.parentElementUUID = null; | 388 | returnObj.parentElementUUID = null; |
389 | returnObj.parentElement = null; | 389 | returnObj.parentElement = null; |
@@ -502,7 +502,10 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
502 | this.playhead.addEventListener("mousedown", this.startPlayheadTracking.bind(this), false); | 502 | this.playhead.addEventListener("mousedown", this.startPlayheadTracking.bind(this), false); |
503 | this.playhead.addEventListener("mouseup", this.stopPlayheadTracking.bind(this), false); | 503 | this.playhead.addEventListener("mouseup", this.stopPlayheadTracking.bind(this), false); |
504 | this.time_markers.addEventListener("click", this.updatePlayhead.bind(this), false); | 504 | this.time_markers.addEventListener("click", this.updatePlayhead.bind(this), false); |
505 | 505 | ||
506 | // Initialize BreadCrumb | ||
507 | this.application.ninja.breadCrumbClick = false; | ||
508 | this.enablePanel(false); | ||
506 | 509 | ||
507 | } | 510 | } |
508 | }, | 511 | }, |
@@ -519,6 +522,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
519 | this.drawTimeMarkers(); | 522 | this.drawTimeMarkers(); |
520 | // Document switching | 523 | // Document switching |
521 | // Check to see if we have saved timeline information in the currentDocument. | 524 | // Check to see if we have saved timeline information in the currentDocument. |
525 | //debugger; | ||
522 | if ((typeof(this.application.ninja.currentDocument.isTimelineInitialized) === "undefined") && | 526 | if ((typeof(this.application.ninja.currentDocument.isTimelineInitialized) === "undefined") && |
523 | (!this.application.ninja.currentDocument.breadCrumbClick)) { | 527 | (!this.application.ninja.currentDocument.breadCrumbClick)) { |
524 | //console.log('TimelinePanel.initTimelineForDocument: new Document'); | 528 | //console.log('TimelinePanel.initTimelineForDocument: new Document'); |
@@ -575,7 +579,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
575 | 579 | ||
576 | // We're reading from the cache, not writing to it. | 580 | // We're reading from the cache, not writing to it. |
577 | this._boolCacheArrays = false; | 581 | this._boolCacheArrays = false; |
578 | |||
579 | for (i = 0; i < tlArrLayersLength; i++) { | 582 | for (i = 0; i < tlArrLayersLength; i++) { |
580 | if (this.application.ninja.currentDocument.tlArrLayers[i].layerData.isSelected === true) { | 583 | if (this.application.ninja.currentDocument.tlArrLayers[i].layerData.isSelected === true) { |
581 | this.application.ninja.currentDocument.tlArrLayers[i].layerData._isFirstDraw = true; | 584 | this.application.ninja.currentDocument.tlArrLayers[i].layerData._isFirstDraw = true; |
@@ -646,6 +649,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
646 | // Clear the timeline but not the cache | 649 | // Clear the timeline but not the cache |
647 | //console.log('TimelinePanel.handleDocumentChange'); | 650 | //console.log('TimelinePanel.handleDocumentChange'); |
648 | if ((event.type === "closeDocument") && (this.application.ninja.documentController._documents.length > 0)) { | 651 | if ((event.type === "closeDocument") && (this.application.ninja.documentController._documents.length > 0)) { |
652 | // Ignore extra closeDocument event that fires while there are still documents open. | ||
649 | return; | 653 | return; |
650 | } | 654 | } |
651 | this._boolCacheArrays = false; | 655 | this._boolCacheArrays = false; |
@@ -668,9 +672,16 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
668 | 672 | ||
669 | handleBreadCrumbBinding:{ | 673 | handleBreadCrumbBinding:{ |
670 | value:function(event){ | 674 | value:function(event){ |
671 | 675 | // Might fire if currentDocument has not yet been initialized. | |
672 | if((typeof(this.application.ninja.currentDocument.isTimelineInitialized) === "undefined")) | 676 | if (this.application.ninja.currentDocument == null) { |
673 | return; | 677 | return; |
678 | } | ||
679 | // Might fire if currentDocument is initialized but cache has not been initialized | ||
680 | if(typeof(this.application.ninja.currentDocument.isTimelineInitialized) === "undefined") { | ||
681 | return; | ||
682 | } | ||
683 | |||
684 | // If the breadCrumb has been clicked, we need to change documents. | ||
674 | if(this.application.ninja.currentDocument.breadCrumbClick){ | 685 | if(this.application.ninja.currentDocument.breadCrumbClick){ |
675 | this.handleDocumentChange(event); | 686 | this.handleDocumentChange(event); |
676 | } | 687 | } |
@@ -1031,7 +1042,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
1031 | 1042 | ||
1032 | this.layerRepetition.selectedIndexes = [layerIndex]; | 1043 | this.layerRepetition.selectedIndexes = [layerIndex]; |
1033 | this.currentLayerSelected = this.arrLayers[layerIndex]; | 1044 | this.currentLayerSelected = this.arrLayers[layerIndex]; |
1034 | |||
1035 | if (userSelection) { | 1045 | if (userSelection) { |
1036 | if (this._captureSelection) { | 1046 | if (this._captureSelection) { |
1037 | 1047 | ||