diff options
Diffstat (limited to 'js/panels')
-rw-r--r-- | js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 69e6527f..c4206b18 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.application.ninja.currentDocument.tlArrLayers = newVal; | ||
31 | } | 32 | } |
32 | }, | 33 | }, |
33 | 34 | ||
@@ -99,6 +100,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
99 | }, | 100 | }, |
100 | set:function (newVal) { | 101 | set:function (newVal) { |
101 | this._arrTracks = newVal; | 102 | this._arrTracks = newVal; |
103 | this.application.ninja.currentDocument.tlArrTracks = newVal; | ||
102 | } | 104 | } |
103 | }, | 105 | }, |
104 | 106 | ||
@@ -172,13 +174,15 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
172 | prepareForDraw:{ | 174 | prepareForDraw:{ |
173 | value:function () { | 175 | value:function () { |
174 | this.initTimeline(); | 176 | this.initTimeline(); |
175 | this.eventManager.addEventListener( "onOpenDocument", this, false); | 177 | this.eventManager.addEventListener("onOpenDocument", this, false); |
176 | this.eventManager.addEventListener("closeDocument", this, false); | 178 | this.eventManager.addEventListener("closeDocument", this, false); |
179 | this.eventManager.addEventListener("switchDocument", this, false); | ||
177 | } | 180 | } |
178 | }, | 181 | }, |
179 | 182 | ||
180 | handleOnOpenDocument:{ | 183 | handleOnOpenDocument:{ |
181 | value:function(){ | 184 | value:function(){ |
185 | this.clearTimelinePanel(); | ||
182 | this.eventManager.addEventListener("deleteLayerClick", this, false); | 186 | this.eventManager.addEventListener("deleteLayerClick", this, false); |
183 | this.eventManager.addEventListener("newLayer", this, false); | 187 | this.eventManager.addEventListener("newLayer", this, false); |
184 | this.eventManager.addEventListener("deleteLayer", this, false); | 188 | this.eventManager.addEventListener("deleteLayer", this, false); |
@@ -202,6 +206,14 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
202 | this.clearTimelinePanel(); | 206 | this.clearTimelinePanel(); |
203 | } | 207 | } |
204 | }, | 208 | }, |
209 | |||
210 | handleSwitchDocument : { | ||
211 | value: function(event) { | ||
212 | // Handle document change. | ||
213 | this.handleOnOpenDocument(); | ||
214 | } | ||
215 | }, | ||
216 | |||
205 | willDraw:{ | 217 | willDraw:{ |
206 | value:function () { | 218 | value:function () { |
207 | if (this._isLayer) { | 219 | if (this._isLayer) { |
@@ -233,9 +245,8 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
233 | initTimelineView:{ | 245 | initTimelineView:{ |
234 | value:function () { | 246 | value:function () { |
235 | var myIndex; | 247 | var myIndex; |
236 | 248 | ||
237 | 249 | this.drawTimeMarkers(); | |
238 | this.drawTimeMarkers(); | ||
239 | 250 | ||
240 | this._hashKey = "123"; | 251 | this._hashKey = "123"; |
241 | _firstLayerDraw = false; | 252 | _firstLayerDraw = false; |
@@ -275,11 +286,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
275 | this.eventManager.removeEventListener("selectionChange", this, true); | 286 | this.eventManager.removeEventListener("selectionChange", this, true); |
276 | 287 | ||
277 | // Remove every event listener for every tween in TimelineTrack | 288 | // Remove every event listener for every tween in TimelineTrack |
278 | for (var i = 0; i < this.arrTracks.length; i++) { | 289 | this.deselectTweens(); |
279 | for (var j = 0; j < this.arrTracks[i].tweens.length; j++) { | ||
280 | this.arrTracks[i].tweens[j].isClearing = "clear it"; | ||
281 | } | ||
282 | } | ||
283 | 290 | ||
284 | // Reset visual appearance | 291 | // Reset visual appearance |
285 | this.application.ninja.timeline.playhead.style.left = "-2px"; | 292 | this.application.ninja.timeline.playhead.style.left = "-2px"; |
@@ -316,7 +323,10 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
316 | this.container_tracks.style.width = (this.end_hottext.value * 80) + "px"; | 323 | this.container_tracks.style.width = (this.end_hottext.value * 80) + "px"; |
317 | this.master_track.style.width = (this.end_hottext.value * 80) + "px"; | 324 | this.master_track.style.width = (this.end_hottext.value * 80) + "px"; |
318 | this.time_markers.style.width = (this.end_hottext.value * 80) + "px"; | 325 | this.time_markers.style.width = (this.end_hottext.value * 80) + "px"; |
319 | this.time_markers.removeChild(this.timeMarkerHolder); | 326 | if (this.timeMarkerHolder) { |
327 | this.time_markers.removeChild(this.timeMarkerHolder); | ||
328 | } | ||
329 | |||
320 | this.drawTimeMarkers(); | 330 | this.drawTimeMarkers(); |
321 | } | 331 | } |
322 | }, | 332 | }, |