diff options
Diffstat (limited to 'js/panels/Timeline/TimelinePanel.reel')
-rw-r--r-- | js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html | 19 | ||||
-rw-r--r-- | js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 389 |
2 files changed, 292 insertions, 116 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html index 92adee05..77481ac0 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.html | |||
@@ -101,6 +101,11 @@ | |||
101 | "boundObjectPropertyPath" : "objectAtCurrentIteration.isTransformCollapsed", | 101 | "boundObjectPropertyPath" : "objectAtCurrentIteration.isTransformCollapsed", |
102 | "oneway" : false | 102 | "oneway" : false |
103 | }, | 103 | }, |
104 | "animateCollapser" : { | ||
105 | "boundObject" : {"@" : "repetition1"}, | ||
106 | "boundObjectPropertyPath" : "objectAtCurrentIteration.animateCollapser", | ||
107 | "oneway" : false | ||
108 | }, | ||
104 | "isSelected" : { | 109 | "isSelected" : { |
105 | "boundObject" : {"@" : "repetition1"}, | 110 | "boundObject" : {"@" : "repetition1"}, |
106 | "boundObjectPropertyPath" : "objectAtCurrentIteration.isSelected", | 111 | "boundObjectPropertyPath" : "objectAtCurrentIteration.isSelected", |
@@ -116,6 +121,11 @@ | |||
116 | "boundObjectPropertyPath" : "objectAtCurrentIteration.isStyleCollapsed", | 121 | "boundObjectPropertyPath" : "objectAtCurrentIteration.isStyleCollapsed", |
117 | "oneway" : false | 122 | "oneway" : false |
118 | }, | 123 | }, |
124 | "animateCollapser" : { | ||
125 | "boundObject" : {"@" : "repetition1"}, | ||
126 | "boundObjectPropertyPath" : "objectAtCurrentIteration.animateCollapser", | ||
127 | "oneway" : false | ||
128 | }, | ||
119 | "dtextPositionX" : { | 129 | "dtextPositionX" : { |
120 | "boundObject" : {"@" : "repetition1"}, | 130 | "boundObject" : {"@" : "repetition1"}, |
121 | "boundObjectPropertyPath" : "objectAtCurrentIteration.dtextPositionX", | 131 | "boundObjectPropertyPath" : "objectAtCurrentIteration.dtextPositionX", |
@@ -164,7 +174,7 @@ | |||
164 | "bindings": { | 174 | "bindings": { |
165 | "objects": { | 175 | "objects": { |
166 | "boundObject": {"@": "owner"}, | 176 | "boundObject": {"@": "owner"}, |
167 | "boundObjectPropertyPath": "arrTracks", | 177 | "boundObjectPropertyPath": "arrLayers", |
168 | "oneway": false | 178 | "oneway": false |
169 | } | 179 | } |
170 | } | 180 | } |
@@ -178,7 +188,7 @@ | |||
178 | "bindings" : { | 188 | "bindings" : { |
179 | "trackID" : { | 189 | "trackID" : { |
180 | "boundObject" : {"@" : "repetition2"}, | 190 | "boundObject" : {"@" : "repetition2"}, |
181 | "boundObjectPropertyPath" : "objectAtCurrentIteration.trackID", | 191 | "boundObjectPropertyPath" : "objectAtCurrentIteration.layerID", |
182 | "oneway" : false | 192 | "oneway" : false |
183 | }, | 193 | }, |
184 | "tweens" : { | 194 | "tweens" : { |
@@ -231,6 +241,11 @@ | |||
231 | "boundObjectPropertyPath" : "objectAtCurrentIteration.isTransformCollapsed", | 241 | "boundObjectPropertyPath" : "objectAtCurrentIteration.isTransformCollapsed", |
232 | "oneway" : false | 242 | "oneway" : false |
233 | }, | 243 | }, |
244 | "animateCollapser" : { | ||
245 | "boundObject" : {"@" : "repetition2"}, | ||
246 | "boundObjectPropertyPath" : "objectAtCurrentIteration.animateCollapser", | ||
247 | "oneway" : false | ||
248 | }, | ||
234 | "isStyleCollapsed" : { | 249 | "isStyleCollapsed" : { |
235 | "boundObject" : {"@" : "repetition2"}, | 250 | "boundObject" : {"@" : "repetition2"}, |
236 | "boundObjectPropertyPath" : "objectAtCurrentIteration.isStyleCollapsed", | 251 | "boundObjectPropertyPath" : "objectAtCurrentIteration.isStyleCollapsed", |
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index d7d5328e..91277a63 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | |||
@@ -28,6 +28,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
28 | }, | 28 | }, |
29 | set:function (newVal) { | 29 | set:function (newVal) { |
30 | this._arrLayers = newVal; | 30 | this._arrLayers = newVal; |
31 | this._cacheArrays(); | ||
31 | } | 32 | } |
32 | }, | 33 | }, |
33 | 34 | ||
@@ -44,6 +45,19 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
44 | } | 45 | } |
45 | }, | 46 | }, |
46 | 47 | ||
48 | _cacheArrays : { | ||
49 | value: function() { | ||
50 | if (this._boolCacheArrays) { | ||
51 | this.application.ninja.currentDocument.tlArrLayers = this.arrLayers; | ||
52 | } | ||
53 | } | ||
54 | }, | ||
55 | |||
56 | // Set to false to skip array caching array sets in current document | ||
57 | _boolCacheArrays : { | ||
58 | value: true | ||
59 | }, | ||
60 | |||
47 | _currentLayerNumber:{ | 61 | _currentLayerNumber:{ |
48 | value:0 | 62 | value:0 |
49 | }, | 63 | }, |
@@ -63,10 +77,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
63 | value: null | 77 | value: null |
64 | }, | 78 | }, |
65 | 79 | ||
66 | currentTrackSelected:{ | ||
67 | value: null | ||
68 | }, | ||
69 | |||
70 | millisecondsOffset:{ | 80 | millisecondsOffset:{ |
71 | value:1000 | 81 | value:1000 |
72 | }, | 82 | }, |
@@ -99,6 +109,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
99 | }, | 109 | }, |
100 | set:function (newVal) { | 110 | set:function (newVal) { |
101 | this._arrTracks = newVal; | 111 | this._arrTracks = newVal; |
112 | this._cacheArrays(); | ||
102 | } | 113 | } |
103 | }, | 114 | }, |
104 | 115 | ||
@@ -163,37 +174,21 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
163 | value:false, | 174 | value:false, |
164 | writable:true | 175 | writable:true |
165 | }, | 176 | }, |
177 | |||
166 | timeMarkerHolder:{ | 178 | timeMarkerHolder:{ |
167 | value: null | 179 | value: null |
168 | }, | 180 | }, |
169 | /* === END: Models === */ | 181 | /* === END: Models === */ |
170 | |||
171 | /* === BEGIN: Draw cycle === */ | 182 | /* === BEGIN: Draw cycle === */ |
172 | prepareForDraw:{ | 183 | prepareForDraw:{ |
173 | value:function () { | 184 | value:function () { |
174 | this.eventManager.addEventListener( "onOpenDocument", this, false); | 185 | this.initTimeline(); |
175 | } | 186 | this.eventManager.addEventListener("onOpenDocument", this, false); |
176 | }, | 187 | this.eventManager.addEventListener("closeDocument", this, false); |
177 | 188 | this.eventManager.addEventListener("switchDocument", this, false); | |
178 | handleOnOpenDocument:{ | ||
179 | value:function(){ | ||
180 | this.eventManager.addEventListener("deleteLayerClick", this, false); | ||
181 | this.eventManager.addEventListener("newLayer", this, false); | ||
182 | this.eventManager.addEventListener("deleteLayer", this, false); | ||
183 | this.eventManager.addEventListener("layerBinding", this, false); | ||
184 | this.eventManager.addEventListener("elementAdded", this, false); | ||
185 | this.eventManager.addEventListener("elementDeleted", this, false); | ||
186 | this.eventManager.addEventListener("deleteSelection", this, false); | ||
187 | this.eventManager.addEventListener("selectionChange", this, true); | ||
188 | this.hashInstance = this.createLayerHashTable(); | ||
189 | this.hashTrackInstance = this.createTrackHashTable(); | ||
190 | this.hashLayerNumber = this.createLayerNumberHash(); | ||
191 | this.hashElementMapToLayer = this.createElementMapToLayer(); | ||
192 | this.initTimelineView(); | ||
193 | |||
194 | |||
195 | } | 189 | } |
196 | }, | 190 | }, |
191 | |||
197 | willDraw:{ | 192 | willDraw:{ |
198 | value:function () { | 193 | value:function () { |
199 | if (this._isLayer) { | 194 | if (this._isLayer) { |
@@ -203,12 +198,37 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
203 | } | 198 | } |
204 | }, | 199 | }, |
205 | /* === END: Draw cycle === */ | 200 | /* === END: Draw cycle === */ |
206 | |||
207 | /* === BEGIN: Controllers === */ | 201 | /* === BEGIN: Controllers === */ |
208 | initTimelineView:{ | 202 | // Bind all document-specific events (pass in true to unbind) |
209 | value:function () { | 203 | _bindDocumentEvents : { |
210 | var myIndex; | 204 | value: function(boolUnbind) { |
211 | this.layout_tracks = this.element.querySelector(".layout-tracks"); | 205 | var arrEvents = ["deleteLayerClick", |
206 | "newLayer", | ||
207 | "deleteLayer", | ||
208 | "layerBinding", | ||
209 | "elementAdded", | ||
210 | "elementDeleted", | ||
211 | "deleteSelection", | ||
212 | "selectionChange"], | ||
213 | i, | ||
214 | arrEventsLength = arrEvents.length; | ||
215 | |||
216 | if (boolUnbind) { | ||
217 | for (i = 0; i < arrEventsLength; i++) { | ||
218 | <