diff options
Diffstat (limited to 'js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js')
-rw-r--r-- | js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index ce52d1f3..350c7311 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | |||
@@ -231,9 +231,10 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
231 | prepareForDraw:{ | 231 | prepareForDraw:{ |
232 | value:function () { | 232 | value:function () { |
233 | this.initTimeline(); | 233 | this.initTimeline(); |
234 | this.eventManager.addEventListener("onOpenDocument", this, false); | 234 | // Bind the event handler for the document change events |
235 | this.eventManager.addEventListener("closeDocument", this, false); | 235 | this.eventManager.addEventListener("onOpenDocument", this.handleDocumentChange.bind(this), false); |
236 | this.eventManager.addEventListener("switchDocument", this, false); | 236 | this.eventManager.addEventListener("closeDocument", this.handleDocumentChange.bind(this), false); |
237 | this.eventManager.addEventListener("switchDocument", this.handleDocumentChange.bind(this), false); | ||
237 | } | 238 | } |
238 | }, | 239 | }, |
239 | 240 | ||
@@ -383,31 +384,18 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { | |||
383 | } | 384 | } |
384 | }, | 385 | }, |
385 | 386 | ||
386 | handleOnOpenDocument:{ | 387 | handleDocumentChange:{ |
387 | value:function(){ | 388 | value:function(){ |
388 | this._boolCacheArrays = false; | 389 | this._boolCacheArrays = false; |
389 | this.clearTimelinePanel(); | 390 | this.clearTimelinePanel(); |
390 | this._boolCacheArrays = true; | 391 | this._boolCacheArrays = true; |
391 | this._bindDocumentEvents(); | 392 | this._bindDocumentEvents(); |
392 | 393 | ||
393 | this.hashInstance = this.createLayerHashTable(); | 394 | this.hashInstance = this.createLayerHashTable(); |
394 | this.hashElementMapToLayer = this.createElementMapToLayer(); | 395 | this.hashElementMapToLayer = this.createElementMapToLayer(); |
395 | this.initTimelineForDocument(); | 396 | this.initTimelineForDocument(); |
396 | } | 397 | } |
397 | }, | 398 | }, |
398 | |||
399 | handleCloseDocument: { | ||
400 | value: function(event) { | ||
401 | this.clearTimelinePanel(); | ||
402 | } | ||
403 | }, | ||
404 | |||
405 | handleSwitchDocument : { | ||
406 | value: function(event) { | ||
407 | // Handle document change. | ||
408 | this.handleOnOpenDocument(); | ||
409 | } | ||
410 | }, | ||
411 | 399 | ||
412 | updateTrackContainerWidth:{ | 400 | updateTrackContainerWidth:{ |
413 | value: function(){ | 401 | value: function(){ |