aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/Timeline')
-rw-r--r--js/panels/Timeline/Layer.reel/Layer.js1
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js118
2 files changed, 98 insertions, 21 deletions
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js
index 1b8d73c0..baf01def 100644
--- a/js/panels/Timeline/Layer.reel/Layer.js
+++ b/js/panels/Timeline/Layer.reel/Layer.js
@@ -577,6 +577,7 @@ var Layer = exports.Layer = Montage.create(Component, {
577 } 577 }
578 } 578 }
579 this._isFirstDraw = false; 579 this._isFirstDraw = false;
580 this.layerData._isFirstDraw = false;
580 } 581 }
581 } 582 }
582 }, 583 },
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index e55f583b..77a4daae 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -83,7 +83,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
83 }, 83 },
84 84
85 _currentLayerSelected:{ 85 _currentLayerSelected:{
86 value:null 86 value: false
87 }, 87 },
88 currentLayerSelected:{ 88 currentLayerSelected:{
89 get:function () { 89 get:function () {
@@ -109,10 +109,20 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
109 return; 109 return;
110 } 110 }
111 if (newVal !== this._selectedLayerID) { 111 if (newVal !== this._selectedLayerID) {
112 //console.log('TimelinePanel.selectLayerID.set')
112 var selectIndex = this.getLayerIndexByID(newVal); 113 var selectIndex = this.getLayerIndexByID(newVal);
113 this._selectedLayerID = newVal; 114 this._selectedLayerID = newVal;
114 this._captureSelection = true; 115 this._captureSelection = true;
115 this.selectLayer(selectIndex, true); 116 if (this.currentLayerSelected !== false) {
117 this.selectLayer(selectIndex, true);
118 }
119 if (this.currentLayersSelected !== false) {
120 this.selectLayers(this.currentLayersSelected);
121 }
122 if ((this.currentLayersSelected === false) && (this.currentLayerSelected === false)) {
123 this.selectLayers([]);
124 }
125
116 } 126 }
117 } 127 }
118 }, 128 },
@@ -125,6 +135,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
125 return this._currentLayersSelected; 135 return this._currentLayersSelected;
126 }, 136 },
127 set:function (newVal) { 137 set:function (newVal) {
138 //console.log("TimelinePanel.currentLayersSelected.set, ", newVal);
128 this._currentLayersSelected = newVal; 139 this._currentLayersSelected = newVal;
129 this.cacheTimeline(); 140 this.cacheTimeline();
130 } 141 }
@@ -443,8 +454,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
443 this.application.ninja.currentDocument.tlArrLayers = []; 454 this.application.ninja.currentDocument.tlArrLayers = [];
444 this.application.ninja.currentDocument.tlCurrentSelectedContainer = this.application.ninja.currentSelectedContainer; 455 this.application.ninja.currentDocument.tlCurrentSelectedContainer = this.application.ninja.currentSelectedContainer;
445 this.application.ninja.currentDocument.tllayerNumber = this.currentLayerNumber; 456 this.application.ninja.currentDocument.tllayerNumber = this.currentLayerNumber;
446 this.application.ninja.currentDocument.tlCurrentLayerSelected = null; 457 this.application.ninja.currentDocument.tlCurrentLayerSelected = false;
447 this.application.ninja.currentDocument.tlCurrentLayersSelected = []; 458 this.application.ninja.currentDocument.tlCurrentLayersSelected = false;
448 } 459 }
449 }, 460 },
450 461
@@ -667,6 +678,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
667 this.checkable_animated.classList.remove("checked"); 678 this.checkable_animated.classList.remove("checked");
668 this.currentLayerNumber = 0; 679 this.currentLayerNumber = 0;
669 this.currentLayerSelected = false; 680 this.currentLayerSelected = false;
681 this.currentLayersSelected = false;
670 this.selectedKeyframes = []; 682 this.selectedKeyframes = [];
671 this.selectedTweens = []; 683 this.selectedTweens = [];
672 this._captureSelection = false; 684 this._captureSelection = false;
@@ -686,7 +698,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
686 value:function (event) { 698 value:function (event) {
687 // Clear the timeline but not the cache 699 // Clear the timeline but not the cache
688 //console.log('TimelinePanel.handleDocumentChange'); 700 //console.log('TimelinePanel.handleDocumentChange');
689// debugger;
690 if(event === undefined){ 701 if(event === undefined){
691 this.application.ninja.currentDocument.setLevel = true; 702 this.application.ninja.currentDocument.setLevel = true;
692 this._boolCacheArrays = false; 703 this._boolCacheArrays = false;
@@ -711,6 +722,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
711 // Ignore extra closeDocument event that fires while there are still documents open. 722 // Ignore extra closeDocument event that fires while there are still documents open.
712 return; 723 return;
713 } 724 }
725 //console.log(event.type);
714 this._boolCacheArrays = false; 726 this._boolCacheArrays = false;
715 this.clearTimelinePanel(); 727 this.clearTimelinePanel();
716 this._boolCacheArrays = true; 728 this._boolCacheArrays = true;
@@ -789,12 +801,21 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
789 handleSelectionChange:{ 801 handleSelectionChange:{
790 value:function () { 802 value:function () {
791 var layerIndex, 803 var layerIndex,
792 i = 0, 804 i = 0,
793 arrLayersLength = this.arrLayers.length; 805 j = 0,
806 arrLayersLength = this.arrLayers.length,
807 intNumSelected = this.application.ninja.selectedElements.length;
794 808
795 this.deselectTweens(); 809 this.deselectTweens();
810 //console.log("TimelinePanel.handleSelectionChange")
811 if (intNumSelected === 0) {
812 this.selectLayers([]);
813 this.currentLayerSelected = false;
814 this.currentLayersSelected = false;
815 }
796 816
797 if (this.application.ninja.selectedElements.length === 1) { 817 if (intNumSelected === 1) {
818 this.currentLayersSelected = false;
798 if (this.application.ninja.selectedElements[0]) { 819 if (this.application.ninja.selectedElements[0]) {
799 for (i = 0; i < arrLayersLength; i++) { 820 for (i = 0; i < arrLayersLength; i++) {
800 if (this.application.ninja.selectedElements[0].uuid === this.arrLayers[i].layerData.elementsList[0].uuid) { 821 if (this.application.ninja.selectedElements[0].uuid === this.arrLayers[i].layerData.elementsList[0].uuid) {
@@ -807,8 +828,22 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
807 } 828 }
808 } 829 }
809 830
810 if (this.application.ninja.selectedElements.length > 1) { 831 if (intNumSelected > 1) {
811 832 // Build an array of indexes of selected layers to give to the selectLayers method
833 var arrSelectedIndexes = [];
834 this.currentLayerSelected = false;
835 for (i = 0; i < intNumSelected; i++) {
836 var currentCheck = this.application.ninja.selectedElements[i].uuid;
837 //console.log("checking ", currentCheck);
838 for (j = 0; j < arrLayersLength; j++) {
839 //console.log(".......... ", this.arrLayers[j].layerData.elementsList[0].uuid)
840 if (currentCheck === this.arrLayers[j].layerData.elementsList[0].uuid) {
841 //console.log("...............Yes!")
842 arrSelectedIndexes.push(j);
843 }
844 }
845 }
846 this.selectLayers(arrSelectedIndexes);
812 } 847 }
813 } 848 }
814 }, 849 },
@@ -819,26 +854,40 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
819 value:function (arrSelectedIndexes) { 854 value:function (arrSelectedIndexes) {
820 855
821 var i = 0, 856 var i = 0,
822 j = 0,
823 arrLayersLength = this.arrLayers.length, 857 arrLayersLength = this.arrLayers.length,
858 arrSelectedIndexesLength = arrSelectedIndexes.length,
824 userSelection = false; 859 userSelection = false;
860
861 //console.log(arrSelectedIndexes);
862
825 863
826 if (this.selectedKeyframes) { 864 if (this.selectedKeyframes) {
827 this.deselectTweens(); 865 this.deselectTweens();
828 } 866 }
829 867
830 for (i = 0; i < arrLayersLength; i++) { 868 for (i = 0; i < arrLayersLength; i++) {
831 if (i === layerIndex) { 869 this.arrLayers[i].layerData.isSelected = false;
832 this.arrLayers[i].layerData.isSelected = true; 870 this.triggerLayerBinding(i);
833 } else { 871 }
834 this.arrLayers[i].layerData.isSelected = false; 872
835 } 873 this.currentLayersSelected = false;
836 874 if (arrSelectedIndexesLength > 0) {
837 this.triggerLayerBinding(i); 875 this.currentLayersSelected = [];
876 }
877
878
879 for (i = 0; i < arrLayersLength; i++) {
880 if (arrSelectedIndexes.indexOf(i) > -1) {
881 this.arrLayers[i].layerData.isSelected = true;
882 this.arrLayers[i].isSelected = true;
883 this.triggerLayerBinding(i);
884 this.currentLayersSelected.push(i);