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 9c782787..190f818c 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
@@ -382,7 +383,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
382 } 383 }
383 }, 384 },
384 385
385 handleOnOpenDocument:{ 386 handleDocumentChange:{
386 value:function(){ 387 value:function(){
387 this._boolCacheArrays = false; 388 this._boolCacheArrays = false;
388 this.clearTimelinePanel(); 389 this.clearTimelinePanel();
@@ -395,19 +396,6 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
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(){