aboutsummaryrefslogtreecommitdiff
path: root/js/panels
diff options
context:
space:
mode:
authorJonathan Duran2012-03-02 09:02:52 -0800
committerJonathan Duran2012-03-02 09:02:52 -0800
commit40c1d9df5b28d37facc10ee6de4d742caed59a6f (patch)
treef462ab583ec2feabc8630892432ef08880a2dfb5 /js/panels
parentef41a2897809d768e066ee3b4bfbb436ab20175c (diff)
downloadninja-40c1d9df5b28d37facc10ee6de4d742caed59a6f.tar.gz
Start looping over tweened properties generically
No longer hard coding for top and left properties. Instead, looping over all tweened properties generically and building keyframe strings. Signed-off-by: Jonathan Duran <jduran@motorola.com>
Diffstat (limited to 'js/panels')
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
index d35f59d3..1521f0fd 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
@@ -562,8 +562,15 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
562 var trackDur = parseInt(this.trackDuration); 562 var trackDur = parseInt(this.trackDuration);
563 var keyframePercent = Math.round((keyMill / trackDur) * 100) + "%"; 563 var keyframePercent = Math.round((keyMill / trackDur) * 100) + "%";
564 var keyframePropertyString = " " + keyframePercent + " {"; 564 var keyframePropertyString = " " + keyframePercent + " {";
565 keyframePropertyString += "top: " + this.tweens[i].tweenedProperties["top"] + "px;"; 565
566 keyframePropertyString += " left: " + this.tweens[i].tweenedProperties["left"] + "px;"; 566 for(var prop in this.tweens[i].tweenedProperties){
567 console.log(prop);
568 keyframePropertyString += prop + ": " + this.tweens[i].tweenedProperties[prop] + "px;";
569 }
570
571 //keyframePropertyString += "top: " + this.tweens[i].tweenedProperties["top"] + "px;";
572 //keyframePropertyString += "left: " + this.tweens[i].tweenedProperties["left"] + "px;";
573
567 keyframePropertyString += "}"; 574 keyframePropertyString += "}";
568 keyframeString += keyframePropertyString; 575 keyframeString += keyframePropertyString;
569 } 576 }