aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js8
-rw-r--r--js/panels/Timeline/Tween.reel/Tween.js6
2 files changed, 13 insertions, 1 deletions
diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
index 0feada6b..912dce83 100644
--- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
+++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js
@@ -273,6 +273,14 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, {
273 this.eventManager.removeEventListener("elementDeleted", this, false); 273 this.eventManager.removeEventListener("elementDeleted", this, false);
274 this.eventManager.removeEventListener("deleteSelection", this, false); 274 this.eventManager.removeEventListener("deleteSelection", this, false);
275 this.eventManager.removeEventListener("selectionChange", this, true); 275 this.eventManager.removeEventListener("selectionChange", this, true);
276
277 // Remove every event listener for every tween in TimelineTrack
278 for (var i = 0; i < this.arrTracks.length; i++) {
279 for (var j = 0; j < this.arrTracks[i].tweens.length; j++) {
280 //this.eventManager.removeEventListener("elementChange", this, false);
281 this.arrTracks[i].tweens[j].eventManager.removeEventListener("elementChange", this.arrTracks[i].tweens[j], false);
282 }
283 }
276 284
277 // Reset visual appearance 285 // Reset visual appearance
278 this.application.ninja.timeline.playhead.style.left = "-2px"; 286 this.application.ninja.timeline.playhead.style.left = "-2px";
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, {
138 138
139 handleElementChange:{ 139 handleElementChange:{
140 value:function (event) { 140 value:function (event) {
141
141 if (event.detail.source && event.detail.source !== "tween") { 142 if (event.detail.source && event.detail.source !== "tween") {
142 // check for correct element selection 143 // check for correct element selection
143 console.log(this.application.ninja.selectedElements[0]._element) 144 console.log("handleElementChange! " + this.tweenID)
145 console.log(this.application.ninja.selectedElements[0]._element);
146 console.log(this.parentComponent.parentComponent.animatedElement);
144 if (this.application.ninja.selectedElements[0]._element != this.parentComponent.parentComponent.animatedElement) { 147 if (this.application.ninja.selectedElements[0]._element != this.parentComponent.parentComponent.animatedElement) {
145 alert("Wrong element selected for this keyframe track"); 148 alert("Wrong element selected for this keyframe track");
146 } else { 149 } else {
@@ -162,6 +165,7 @@ var Tween = exports.Tween = Montage.create(Component, {
162 selectTween:{ 165 selectTween:{
163 value: function(){ 166 value: function(){
164 // turn on event listener for element change 167 // turn on event listener for element change
168 console.log('adding elementChange event listener for tween ' + this.tweenID)
165 this.eventManager.addEventListener("elementChange", this, false); 169 this.eventManager.addEventListener("elementChange", this, false);
166 170
167 // select the containing layer 171 // select the containing layer