aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js22
1 files changed, 5 insertions, 17 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index 0185d448..cd7622b1 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -217,9 +217,10 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
217 prepareForDraw:{ 217 prepareForDraw:{
218 value:function () { 218 value:function () {
219 this.initTimeline(); 219 this.initTimeline();
220 this.eventManager.addEventListener("onOpenDocument", this, false); 220 // Bind the event handler for the document change events
221 this.eventManager.addEventListener("closeDocument", this, false); 221 this.eventManager.addEventListener("onOpenDocument", this.handleDocumentChange.bind(this), false);
222 this.eventManager.addEventListener("switchDocument", this, false); 222 this.eventManager.addEventListener("closeDocument", this.handleDocumentChange.bind(this), false);
223 this.eventManager.addEventListener("switchDocument", this.handleDocumentChange.bind(this), false);
223 } 224 }
224 }, 225 },
225 226
@@ -368,7 +369,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
368 } 369 }
369 }, 370 },
370 371
371 handleOnOpenDocument:{ 372 handleDocumentChange:{
372 value:function(){ 373 value:function(){
373 this._boolCacheArrays = false; 374 this._boolCacheArrays = false;
374 this.clearTimelinePanel(); 375 this.clearTimelinePanel();
@@ -380,19 +381,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
380 this.initTimelineForDocument(); 381 this.initTimelineForDocument();
381 } 382 }
382 }, 383 },
383
384 handleCloseDocument: {
385 value: function(event) {
386 this.clearTimelinePanel();
387 }
388 },
389
390 handleSwitchDocument : {
391 value: function(event) {
392 // Handle document change.
393 this.handleOnOpenDocument();
394 }
395 },
396 384
397 updateTrackContainerWidth:{ 385 updateTrackContainerWidth:{
398 value: function(){ 386 value: function(){