aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/Tween.reel/Tween.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/Timeline/Tween.reel/Tween.js')
-rw-r--r--js/panels/Timeline/Tween.reel/Tween.js39
1 files changed, 28 insertions, 11 deletions
diff --git a/js/panels/Timeline/Tween.reel/Tween.js b/js/panels/Timeline/Tween.reel/Tween.js
index 5410c77c..e4fb42b3 100644
--- a/js/panels/Timeline/Tween.reel/Tween.js
+++ b/js/panels/Timeline/Tween.reel/Tween.js
@@ -166,27 +166,44 @@ var Tween = exports.Tween = Montage.create(Component, {
166 166
167 handleElementChange:{ 167 handleElementChange:{
168 value:function (event) { 168 value:function (event) {
169 169 // temp - testing var
170 var useAbsolute = true;
171
170 if (event.detail.source && event.detail.source !== "tween") { 172 if (event.detail.source && event.detail.source !== "tween") {
171 // check for correct element selection 173 // check for correct element selection
172 if (this.application.ninja.selectedElements[0]!= this.parentComponent.parentComponent.animatedElement) { 174 if (this.application.ninja.selectedElements[0] != this.parentComponent.parentComponent.animatedElement) {
173 console.log("Wrong element selected for this keyframe track"); 175 console.log("Wrong element selected for this keyframe track");
174 } else { 176 } else {
175 // update tweenedProperties and tell containing track to update CSS rule 177 if(useAbsolute){
176 // temp read only top and left. need to change to loop over event details for prop changes generically 178 this.setAbsoluteTweenProperties(event.detail);
177 if (this.parentComponent.parentComponent.animatedElement.offsetTop != this.tweenedProperties["top"] && this.parentComponent.parentComponent.animatedElement.offsetLeft != this.tweenedProperties["left"]) { 179 } else {
178 this.tweenedProperties["top"] = this.parentComponent.parentComponent.animatedElement.offsetTop; 180 this.setRelativeTweenProperties(event.detail);
179 this.tweenedProperties["left"] = this.parentComponent.parentComponent.animatedElement.offsetLeft;
180 this.parentComponent.parentComponent.updateKeyframeRule();
181 } 181 }
182 // highlight the tween's span
183 this.tweenspan.highlightSpan();
184 this.isTweenAnimated = true;
185 } 182 }
186 } 183 }
187 } 184 }
188 }, 185 },
189 186
187 setAbsoluteTweenProperties:{
188 value:function (eventDetail) {
189 console.log(eventDetail);
190 if (this.parentComponent.parentComponent.animatedElement.offsetTop != this.tweenedProperties["top"] && this.parentComponent.parentComponent.animatedElement.offsetLeft != this.tweenedProperties["left"]) {
191 this.tweenedProperties["top"] = this.parentComponent.parentComponent.animatedElement.offsetTop;
192 this.tweenedProperties["left"] = this.parentComponent.parentComponent.animatedElement.offsetLeft;
193 this.parentComponent.parentComponent.updateKeyframeRule();
194 }
195 // highlight the tween's span
196 this.tweenspan.highlightSpan();
197 this.isTweenAnimated = true;
198 }
199 },
200
201 setRelativeTweenProperties:{
202 value:function(eventDetail){
203
204 }
205 },
206
190 selectTween:{ 207 selectTween:{
191 value: function(){ 208 value: function(){
192 // turn on event listener for element change 209 // turn on event listener for element change