aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/Timeline')
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js45
1 files changed, 36 insertions, 9 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index 48818e44..cb4fbf07 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -329,6 +329,12 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
329 useAbsolutePosition:{ 329 useAbsolutePosition:{
330 value:true 330 value:true
331 }, 331 },
332 _currentDocumentUuid: {
333 value: false
334 },
335 _ignoreSelectionChanges: {
336 value: false
337 },
332 /* === END: Models === */ 338 /* === END: Models === */
333 /* === BEGIN: Draw cycle === */ 339 /* === BEGIN: Draw cycle === */
334 prepareForDraw:{ 340 prepareForDraw:{
@@ -584,6 +590,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
584 this.drawTimeMarkers(); 590 this.drawTimeMarkers();
585 // Document switching 591 // Document switching
586 // Check to see if we have saved timeline information in the currentDocument. 592 // Check to see if we have saved timeline information in the currentDocument.
593 //console.log("TimelinePanel.initTimelineForDocument");
594
587 if ((typeof(this.application.ninja.currentDocument.isTimelineInitialized) === "undefined")) { 595 if ((typeof(this.application.ninja.currentDocument.isTimelineInitialized) === "undefined")) {
588 //console.log('TimelinePanel.initTimelineForDocument: new Document'); 596 //console.log('TimelinePanel.initTimelineForDocument: new Document');
589 // No, we have no information stored. 597 // No, we have no information stored.
@@ -609,12 +617,14 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
609 // Draw the repetition. 617 // Draw the repetition.
610 this.arrLayers = this.temparrLayers; 618 this.arrLayers = this.temparrLayers;
611 this.currentLayerNumber = this.arrLayers.length; 619 this.currentLayerNumber = this.arrLayers.length;
620 this._currentDocumentUuid = this.application.ninja.currentDocument.uuid;
612 boolAlreadyInitialized = true; 621 boolAlreadyInitialized = true;
613 622
614 } else if (this.application.ninja.currentDocument.setLevel) { 623 } else if (this.application.ninja.currentDocument.setLevel) {
615 //console.log('TimelinePanel.initTimelineForDocument: breadCrumbClick'); 624 //console.log('TimelinePanel.initTimelineForDocument: breadCrumbClick');
616 // Information stored, but we're moving up or down in the breadcrumb. 625 // Information stored, but we're moving up or down in the breadcrumb.
617 // Get the current selection and restore timeline info for its children. 626 // Get the current selection and restore timeline info for its children.
627 //debugger;
618 var parentNode = this.application.ninja.currentSelectedContainer, 628 var parentNode = this.application.ninja.currentSelectedContainer,
619 storedCurrentLayerNumber = this.application.ninja.currentDocument.tllayerNumber; 629 storedCurrentLayerNumber = this.application.ninja.currentDocument.tllayerNumber;
620 this.temparrLayers = []; 630 this.temparrLayers = [];
@@ -650,6 +660,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
650 this.currentLayerNumber = this.application.ninja.currentDocument.tllayerNumber; 660 this.currentLayerNumber = this.application.ninja.currentDocument.tllayerNumber;
651 this.currentLayerSelected = this.application.ninja.currentDocument.tlCurrentLayerSelected; 661 this.currentLayerSelected = this.application.ninja.currentDocument.tlCurrentLayerSelected;
652 this.currentLayersSelected = this.application.ninja.currentDocument.tlCurrentLayersSelected; 662 this.currentLayersSelected = this.application.ninja.currentDocument.tlCurrentLayersSelected;
663 this._currentDocumentUuid = this.application.ninja.currentDocument.uuid;
653 664
654 665
655 //debugger; 666 //debugger;
@@ -710,12 +721,21 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
710 721
711 handleDocumentChange:{ 722 handleDocumentChange:{
712 value:function () { 723 value:function () {
724 // console.log("TimelinePanel.handleDocumentChange");
725
713 if (this.application.ninja.currentDocument == null) { 726 if (this.application.ninja.currentDocument == null) {
714 // On app initialization, the binding is triggered before 727 // On app initialization, the binding is triggered before
715 // there is a currentDocument. We don't do anything at that time. 728 // there is a currentDocument. We don't do anything at that time.
716 return; 729 return;
717 } 730 }
718 // this.application.ninja.currentDocument.setLevel = true; 731
732 // Is this the same document?
733 if (this._currentDocumentUuid === this.application.ninja.currentDocument.uuid) {
734 // Yes, same document, so we are changing levels.
735 this.application.ninja.currentDocument.setLevel = true;
736 this._ignoreSelectionChanges = true;
737 }
738
719 this._boolCacheArrays = false; 739 this._boolCacheArrays = false;
720 this.clearTimelinePanel(); 740 this.clearTimelinePanel();
721 this._boolCacheArrays = true; 741 this._boolCacheArrays = true;
@@ -799,15 +819,20 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
799 arrLayersLength = this.arrLayers.length, 819 arrLayersLength = this.arrLayers.length,
800 intNumSelected = this.application.ninja.selectedElements.length, 820 intNumSelected = this.application.ninja.selectedElements.length,
801 checkIndex = 0; 821 checkIndex = 0;
802 822
803 this.deselectTweens(); 823 //console.log("TimelinePanel.handleSelectionChange, intNumSelected is ", intNumSelected)
804 //console.log("TimelinePanel.handleSelectionChange") 824
805 if (intNumSelected === 0) { 825 if (intNumSelected === 0) {
806 this.selectLayers([]); 826 if (this._ignoreSelectionChanges !== true) {
827 this.selectLayers([]);
828 } else {
829 this._ignoreSelectionChanges = false;
830 }
831
807 this.currentLayerSelected = false; 832 this.currentLayerSelected = false;
808 this.currentLayersSelected = false; 833 this.currentLayersSelected = false;
809 } 834 }
810 835
811 if (intNumSelected === 1) { 836 if (intNumSelected === 1) {
812 this.currentLayersSelected = false; 837 this.currentLayersSelected = false;
813 if (this.application.ninja.selectedElements[0]) { 838 if (this.application.ninja.selectedElements[0]) {
@@ -858,7 +883,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
858 883
859 //console.log(arrSelectedIndexes); 884 //console.log(arrSelectedIndexes);
860 885
861 886
862 if (this.selectedKeyframes) { 887 if (this.selectedKeyframes) {
863 this.deselectTweens(); 888 this.deselectTweens();
864 } 889 }
@@ -867,8 +892,10 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
867 this.arrLayers[i].layerData.isSelected = false; 892 this.arrLayers[i].layerData.isSelected = false;
868 this.triggerLayerBinding(i); 893 this.triggerLayerBinding(i);
869 } 894 }
870 895
871 this.currentLayersSelected = false; 896 if (this.currentLayersSelected !== false) {
897 this.currentLayersSelected = false;
898 }
872 if (arrSelectedIndexesLength > 0) { 899 if (arrSelectedIndexesLength > 0) {
873 this.currentLayersSelected = []; 900 this.currentLayersSelected = [];
874 } 901 }