aboutsummaryrefslogtreecommitdiff
path: root/js/panels
diff options
context:
space:
mode:
authorJon Reid2012-03-07 14:27:08 -0800
committerJon Reid2012-03-07 14:27:08 -0800
commit18be6028647017d053424cdd160ef7afc9351fd2 (patch)
tree74c7121f26fefd6a9c421df7fb2966a15098fa7d /js/panels
parent27f0a1813a0a025448c36b458d8a441a1459bf9a (diff)
downloadninja-18be6028647017d053424cdd160ef7afc9351fd2.tar.gz
Timeline: Bug fix: IKNINJA-1283 When a second document is open and closed, the first document gets wiped out and Timeline is no longer functional.
Diffstat (limited to 'js/panels')
-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(){