aboutsummaryrefslogtreecommitdiff
path: root/js/panels
diff options
context:
space:
mode:
authorJonathan Duran2012-06-26 13:52:33 -0700
committerJonathan Duran2012-06-26 13:52:33 -0700
commite4304b9ac6c58802de4dd334be1f5802533f5160 (patch)
treed2de06b6534f8de1b29870954fcc8b4d13c91300 /js/panels
parent5f07a68a6b97bf7e3549112dedf5676744846971 (diff)
parent9aa987003f0c7866e66aabcc7d9cc2b9da8ed91c (diff)
downloadninja-e4304b9ac6c58802de4dd334be1f5802533f5160.tar.gz
Merge branch 'refs/heads/timeline-local' into TimelineUber
Diffstat (limited to 'js/panels')
-rw-r--r--js/panels/Timeline/Layer.reel/Layer.js19
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js26
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js14
3 files changed, 56 insertions, 3 deletions
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js
index 776d5ec8..2deb20da 100644
--- a/js/panels/Timeline/Layer.reel/Layer.js
+++ b/js/panels/Timeline/Layer.reel/Layer.js
@@ -752,12 +752,20 @@ var Layer = exports.Layer = Montage.create(Component, {
752 //defaultEventManager.dispatchEvent(newEvent); 752 //defaultEventManager.dispatchEvent(newEvent);
753 753
754 // Dispatch the event to the TimelineTrack component associated with this Layer. 754 // Dispatch the event to the TimelineTrack component associated with this Layer.
755 var myIndex = this.application.ninja.timeline.getActiveLayerIndex(), 755 var myIndex = false,
756 i = 0,
757 arrLayersLength = this.parentComponent.parentComponent.arrLayers.length,
756 arrTracks = document.querySelectorAll('[data-montage-id="track"]'); 758 arrTracks = document.querySelectorAll('[data-montage-id="track"]');
757 759
760 for (i = 0; i < arrLayersLength; i++) {
761 if (this.stageElement == this.parentComponent.parentComponent.arrLayers[i].layerData.stageElement) {
762 myIndex = i;
763 }
764 }
765
758 if (myIndex !== false) { 766 if (myIndex !== false) {
759 arrTracks[myIndex].dispatchEvent(newEvent); 767 arrTracks[myIndex].dispatchEvent(newEvent);
760 } 768 }
761 } 769 }
762 }, 770 },
763 771
@@ -945,12 +953,14 @@ var Layer = exports.Layer = Montage.create(Component, {
945 this.isMainCollapsed = false; 953 this.isMainCollapsed = false;
946 } else { 954 } else {
947 this.isMainCollapsed = true; 955 this.isMainCollapsed = true;
956 this.application.ninja.timeline.synchScrollbars(43);
948 } 957 }
949 this.triggerOutgoingBinding(); 958 this.triggerOutgoingBinding();
950 } 959 }
951 }, 960 },
952 handlePositionCollapserClick : { 961 handlePositionCollapserClick : {
953 value: function(event) { 962 value: function(event) {
963 var myHeight = this.positionCollapser.element.offsetHeight;
954 this.positionCollapser.bypassAnimation = false; 964 this.positionCollapser.bypassAnimation = false;
955 this.bypassAnimation = false; 965 this.bypassAnimation = false;
956 this.layerData.bypassAnimation = false; 966 this.layerData.bypassAnimation = false;
@@ -958,12 +968,14 @@ var Layer = exports.Layer = Montage.create(Component, {
958 this.isPositionCollapsed = false; 968 this.isPositionCollapsed = false;
959 } else { 969 } else {
960 this.isPositionCollapsed = true; 970 this.isPositionCollapsed = true;
971 this.application.ninja.timeline.synchScrollbars(myHeight);
961 } 972 }
962 this.triggerOutgoingBinding(); 973 this.triggerOutgoingBinding();
963 } 974 }
964 }, 975 },
965 handleStyleCollapserClick : { 976 handleStyleCollapserClick : {
966 value: function(event) { 977 value: function(event) {
978 var myHeight = this.styleCollapser.element.offsetHeight;
967 this.styleCollapser.bypassAnimation = false; 979 this.styleCollapser.bypassAnimation = false;
968 this.bypassAnimation = false; 980 this.bypassAnimation = false;
969 this.layerData.bypassAnimation = false; 981 this.layerData.bypassAnimation = false;
@@ -971,6 +983,7 @@ var Layer = exports.Layer = Montage.create(Component, {
971 this.isStyleCollapsed = false; 983 this.isStyleCollapsed = false;
972 } else { 984 } else {
973 this.isStyleCollapsed = true; 985 this.isStyleCollapsed = true;
986 this.application.ninja.timeline.synchScrollbars(myHeight);
974 } 987 }
975 this.triggerOutgoingBinding(); 988 this.triggerOutgoingBinding();
976 } 989 }
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index 040ae7be..4185e54a 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -243,6 +243,10 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
243 value: false 243 value: false
244 }, 244 },
245 245
246 _areTracksCollapsing: {
247 value: false
248 },
249
246 _currentOpenSpanMenu: { 250 _currentOpenSpanMenu: {
247 value: false 251 value: false
248 }, 252 },
@@ -687,6 +691,14 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
687 // We have shuffled layers, so we need to update this.selectedLayers. 691 // We have shuffled layers, so we need to update this.selectedLayers.
688 this.selectLayers([]) 692 this.selectLayers([])
689 } 693 }
694
695 // Do we need to scroll the layers?
696 if (this._areTracksCollapsing !== false) {
697 //console.log("diddraw: user_layers, layout_tracks", this.user_layers.scrollTop, this.layout_tracks.scrollTop);
698 //this.layout_tracks.scrollTop = this.user_layers.scrollTop;\
699 this.layout_tracks.scrollTop = this._areTracksCollapsing;
700 this._areTracksCollapsing = false;
701 }
690 } 702 }
691 }, 703 },
692 704
@@ -1097,11 +1109,25 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
1097 this.drawTimeMarkers(); 1109 this.drawTimeMarkers();
1098 } 1110 }
1099 }, 1111 },
1112
1113 synchScrollbars: {
1114 value: function(intScrollBy) {
1115 //this.updateLayerScroll();
1116 //this.user_layers.scrollTop = 0;
1117 //this.layout_tracks.scrollTop = this.user_layers.scrollTop;
1118 //console.log("synch: user_layers, layout_tracks", this.user_layers.scrollTop, this.layout_tracks.scrollTop);
1119 this._areTracksCollapsing = this.layout_tracks.scrollTop - intScrollBy;
1120 this.needsDraw = true;
1121
1122 }
1123 },
1100 1124
1101 updateLayerScroll:{ 1125 updateLayerScroll:{
1102 value:function () { 1126 value:function () {
1127 //console.log("TimelinePanel.updateLayerScroll")
1103 this._areTracksScrolling = true; 1128 this._areTracksScrolling = true;
1104 this.needsDraw = true; 1129 this.needsDraw = true;
1130
1105 } 1131 }
1106 }, 1132 },
1107 1133
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
index 98989022..d4eabbf5 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
@@ -72,6 +72,19 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
72 this.trackData.isVisible = value; 72 this.trackData.isVisible = value;
73 } 73 }
74 }, 74 },
75
76 _stageElement: {
77 value: null
78 },
79 stageElement: {
80 get: function() {
81 return this._stageElement;
82 },
83 set: function(newVal) {
84 this._stageElement = newVal;
85 this.trackData.stageElement = newVal;
86 }
87 },
75 88
76 // Are the various collapsers collapsed or not 89 // Are the various collapsers collapsed or not
77 _isMainCollapsed:{ 90 _isMainCollapsed:{
@@ -484,6 +497,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
484 this.isStyleCollapsed = this.trackData.isStyleCollapsed; 497 this.isStyleCollapsed = this.trackData.isStyleCollapsed;
485 this.trackPosition = this.trackData.trackPosition; 498 this.trackPosition = this.trackData.trackPosition;
486 this.isVisible = this.trackData.isVisible; 499 this.isVisible = this.trackData.isVisible;
500 this.stageElement = this.trackData.stageElement;
487 this.trackEditorProperty = "master"; 501 this.trackEditorProperty = "master";
488 this.needsDraw = true; 502 this.needsDraw = true;
489 } 503 }