aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/Tween.reel/Tween.js
diff options
context:
space:
mode:
authorJonathan Duran2012-05-14 22:09:35 -0700
committerJonathan Duran2012-05-14 22:09:35 -0700
commiteb7c3c8db304bdfb01f747a50e932665d9ec03fa (patch)
tree7afd9d06716f15075fcd845acfe779de4daf39ab /js/panels/Timeline/Tween.reel/Tween.js
parent8c464561e0c55dc5bf67e1e815678e0d07dc4727 (diff)
downloadninja-eb7c3c8db304bdfb01f747a50e932665d9ec03fa.tar.gz
style keyframe rule addition
Signed-off-by: Jonathan Duran <jduran@motorola.com>
Diffstat (limited to 'js/panels/Timeline/Tween.reel/Tween.js')
-rw-r--r--js/panels/Timeline/Tween.reel/Tween.js50
1 files changed, 43 insertions, 7 deletions
diff --git a/js/panels/Timeline/Tween.reel/Tween.js b/js/panels/Timeline/Tween.reel/Tween.js
index 48b41023..b8cc4a07 100644
--- a/js/panels/Timeline/Tween.reel/Tween.js
+++ b/js/panels/Timeline/Tween.reel/Tween.js
@@ -178,16 +178,23 @@ var Tween = exports.Tween = Montage.create(Component, {
178 var useAbsolute = true; 178 var useAbsolute = true;
179 179
180 if (event.detail.source && event.detail.source !== "tween") { 180 if (event.detail.source && event.detail.source !== "tween") {
181 // check for correct element selection 181
182 if (this.application.ninja.selectedElements[0] != this.parentComponent.parentComponent.animatedElement) { 182 if(this.parentComponent.parentComponent.isSubproperty){
183 console.log("Wrong element selected for this keyframe track"); 183 this.setStyleTweenProperty(event.detail);
184 } else { 184 } else {
185 if(useAbsolute){ 185 // check for correct element selection
186 this.setAbsoluteTweenProperties(event.detail); 186 if (this.application.ninja.selectedElements[0] != this.parentComponent.parentComponent.animatedElement) {
187 console.log("Wrong element selected for this keyframe track");
187 } else { 188 } else {
188 this.setRelativeTweenProperties(event.detail); 189 if (useAbsolute) {
190 this.setAbsoluteTweenProperties(event.detail);
191 } else {
192 this.setRelativeTweenProperties(event.detail);
193 }
189 } 194 }
190 } 195 }
196
197
191 } 198 }
192 } 199 }
193 }, 200 },
@@ -231,6 +238,36 @@ var Tween = exports.Tween = Montage.create(Component, {
231 } 238 }
232 }, 239 },
233 240
241 setStyleTweenProperty:{
242 value:function (eventDetail) {
243 console.log("Setting style tween properties for: " + this.parentComponent.parentComponent.trackEditorProperty);
244 console.log(eventDetail);
245
246 if(eventDetail.type == "setProperties"){
247 // ignore top, left, width, and height
248 console.log(eventDetail.data.value[0]);
249 this.tweenedProperties[this.parentComponent.parentComponent.trackEditorProperty] = eventDetail.data.value[0];
250 console.log(this.tweenedProperties);
251
252 } else if(eventDetail.type == "setColor"){
253 console.log(eventDetail.data.value.color.css);
254 var prop = this.parentComponent.parentComponent.trackEditorProperty;
255 this.tweenedProperties[prop] = eventDetail.data.value.color.css;
256 console.log(this.tweenedProperties[prop]);
257
258 } else if(eventDetail.type == "setProperty"){
259 // ignore top, left, width, and height
260 console.log(eventDetail.data.value[0]);
261 this.tweenedProperties[this.parentComponent.parentComponent.trackEditorProperty] = eventDetail.data.value[0];
262 console.log(this.tweenedProperties);
263 }else {
264 console.log("TWEEN Unhandled type - setStyleTweenProperty : " + eventDetail.type);
265 }
266
267
268 }
269 },
270
234 selectTween:{ 271 selectTween:{
235 value: function(){ 272 value: function(){
236 // turn on event listener for element change 273 // turn on event listener for element change
@@ -252,7 +289,6 @@ var Tween = exports.Tween = Montage.create(Component, {
252 this.application.ninja.timeline.updateTimeText(currentMillisec); 289 this.application.ninja.timeline.updateTimeText(currentMillisec);
253 290
254 if(this.parentComponent.parentComponent.isSubproperty){ 291 if(this.parentComponent.parentComponent.isSubproperty){
255 console.log("sub prop tween selection");
256 // set property specific style on element 292 // set property specific style on element
257 } else { 293 } else {
258 // move animated element to correct position on stage 294 // move animated element to correct position on stage