From 5179adf63d25856a8ee96005678d7a6ac626cba6 Mon Sep 17 00:00:00 2001 From: Jon Reid Date: Mon, 27 Feb 2012 13:31:39 -0800 Subject: Timeline: More work on clear timeline method. --- js/panels/Timeline/Tween.reel/Tween.js | 1 + 1 file changed, 1 insertion(+) (limited to 'js/panels/Timeline/Tween.reel/Tween.js') diff --git a/js/panels/Timeline/Tween.reel/Tween.js b/js/panels/Timeline/Tween.reel/Tween.js index f6dbf32c..70b52297 100644 --- a/js/panels/Timeline/Tween.reel/Tween.js +++ b/js/panels/Timeline/Tween.reel/Tween.js @@ -140,6 +140,7 @@ var Tween = exports.Tween = Montage.create(Component, { value:function (event) { if (event.detail.source && event.detail.source !== "tween") { // check for correct element selection + console.log(this.application.ninja.selectedElements[0]._element) if (this.application.ninja.selectedElements[0]._element != this.parentComponent.parentComponent.animatedElement) { alert("Wrong element selected for this keyframe track"); } else { -- cgit v1.2.3 From 445180591da04f681a22038600e8ab517b82c0ca Mon Sep 17 00:00:00 2001 From: Jon Reid Date: Mon, 27 Feb 2012 20:26:49 -0800 Subject: Timeline: try to clean up bogus events manually. --- js/panels/Timeline/Tween.reel/Tween.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'js/panels/Timeline/Tween.reel/Tween.js') diff --git a/js/panels/Timeline/Tween.reel/Tween.js b/js/panels/Timeline/Tween.reel/Tween.js index 70b52297..a9ee1fec 100644 --- a/js/panels/Timeline/Tween.reel/Tween.js +++ b/js/panels/Timeline/Tween.reel/Tween.js @@ -138,9 +138,12 @@ var Tween = exports.Tween = Montage.create(Component, { handleElementChange:{ value:function (event) { + if (event.detail.source && event.detail.source !== "tween") { // check for correct element selection - console.log(this.application.ninja.selectedElements[0]._element) + console.log("handleElementChange! " + this.tweenID) + console.log(this.application.ninja.selectedElements[0]._element); + console.log(this.parentComponent.parentComponent.animatedElement); if (this.application.ninja.selectedElements[0]._element != this.parentComponent.parentComponent.animatedElement) { alert("Wrong element selected for this keyframe track"); } else { @@ -162,6 +165,7 @@ var Tween = exports.Tween = Montage.create(Component, { selectTween:{ value: function(){ // turn on event listener for element change + console.log('adding elementChange event listener for tween ' + this.tweenID) this.eventManager.addEventListener("elementChange", this, false); // select the containing layer -- cgit v1.2.3 From 0031310ea80a33b1752d3813070b00215f0c52c6 Mon Sep 17 00:00:00 2001 From: Jon Reid Date: Mon, 27 Feb 2012 21:55:37 -0800 Subject: Timeline: Successfully unbind event listeners in tweens when clearing timeline. --- js/panels/Timeline/Tween.reel/Tween.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'js/panels/Timeline/Tween.reel/Tween.js') diff --git a/js/panels/Timeline/Tween.reel/Tween.js b/js/panels/Timeline/Tween.reel/Tween.js index a9ee1fec..729abd64 100644 --- a/js/panels/Timeline/Tween.reel/Tween.js +++ b/js/panels/Timeline/Tween.reel/Tween.js @@ -118,6 +118,21 @@ var Tween = exports.Tween = Montage.create(Component, { this.needsDraw = true; } }, + + _isClearing : { + serializable: true, + value: false + }, + isClearing : { + get: function() { + return this._isClearing; + }, + set: function(newVal) { + if (newVal === "clear it") { + this.eventManager.removeEventListener("elementChange", this, false); + } + } + }, prepareForDraw:{ value:function () { @@ -141,9 +156,6 @@ var Tween = exports.Tween = Montage.create(Component, { if (event.detail.source && event.detail.source !== "tween") { // check for correct element selection - console.log("handleElementChange! " + this.tweenID) - console.log(this.application.ninja.selectedElements[0]._element); - console.log(this.parentComponent.parentComponent.animatedElement); if (this.application.ninja.selectedElements[0]._element != this.parentComponent.parentComponent.animatedElement) { alert("Wrong element selected for this keyframe track"); } else { @@ -165,7 +177,6 @@ var Tween = exports.Tween = Montage.create(Component, { selectTween:{ value: function(){ // turn on event listener for element change - console.log('adding elementChange event listener for tween ' + this.tweenID) this.eventManager.addEventListener("elementChange", this, false); // select the containing layer -- cgit v1.2.3