aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/Tween.reel
diff options
context:
space:
mode:
authorJonathan Duran2012-04-11 08:28:07 -0700
committerJonathan Duran2012-04-11 08:28:07 -0700
commit7547b87f99a3a8903955e5b026b0a4ea889fb87a (patch)
treebefe9b7b4e5ad3ed08d200b93e6715d9ea7fb7be /js/panels/Timeline/Tween.reel
parentbd4c9a4630f5de3571e68b8779dc1b6604095781 (diff)
downloadninja-7547b87f99a3a8903955e5b026b0a4ea889fb87a.tar.gz
More Absolute vs Relative changes and cleanup
Signed-off-by: Jonathan Duran <jduran@motorola.com>
Diffstat (limited to 'js/panels/Timeline/Tween.reel')
-rw-r--r--js/panels/Timeline/Tween.reel/Tween.js24
1 files changed, 11 insertions, 13 deletions
diff --git a/js/panels/Timeline/Tween.reel/Tween.js b/js/panels/Timeline/Tween.reel/Tween.js
index 0a67df43..e4fb42b3 100644
--- a/js/panels/Timeline/Tween.reel/Tween.js
+++ b/js/panels/Timeline/Tween.reel/Tween.js
@@ -166,29 +166,27 @@ 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
190 setAbsoluteTweenProperties:{ 187 setAbsoluteTweenProperties:{
191 value:function () { 188 value:function (eventDetail) {
189 console.log(eventDetail);
192 if (this.parentComponent.parentComponent.animatedElement.offsetTop != this.tweenedProperties["top"] && this.parentComponent.parentComponent.animatedElement.offsetLeft != this.tweenedProperties["left"]) { 190 if (this.parentComponent.parentComponent.animatedElement.offsetTop != this.tweenedProperties["top"] && this.parentComponent.parentComponent.animatedElement.offsetLeft != this.tweenedProperties["left"]) {
193 this.tweenedProperties["top"] = this.parentComponent.parentComponent.animatedElement.offsetTop; 191 this.tweenedProperties["top"] = this.parentComponent.parentComponent.animatedElement.offsetTop;
194 this.tweenedProperties["left"] = this.parentComponent.parentComponent.animatedElement.offsetLeft; 192 this.tweenedProperties["left"] = this.parentComponent.parentComponent.animatedElement.offsetLeft;
@@ -201,7 +199,7 @@ var Tween = exports.Tween = Montage.create(Component, {
201 }, 199 },
202 200
203 setRelativeTweenProperties:{ 201 setRelativeTweenProperties:{
204 value:function(){ 202 value:function(eventDetail){
205 203
206 } 204 }
207 }, 205 },