aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/TimelineTrack.reel
diff options
context:
space:
mode:
authorValerio Virgillito2012-02-28 13:41:12 -0800
committerValerio Virgillito2012-02-28 13:41:12 -0800
commitb0b4d6492d6ddd3b7ab39c2f4d1c01b8e9bacfb6 (patch)
treee48cd56730d8a3327cd8c34e602f704701ce6115 /js/panels/Timeline/TimelineTrack.reel
parent7cafa0464ee0c1621ffea04c2192f19008c9fc49 (diff)
parent538db48f38ad3d5d22e99c2881745fc916e7e8a2 (diff)
downloadninja-b0b4d6492d6ddd3b7ab39c2f4d1c01b8e9bacfb6.tar.gz
Merge pull request #78 from imix23ways/Timeline
Timeline bug fixes
Diffstat (limited to 'js/panels/Timeline/TimelineTrack.reel')
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html5
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js8
2 files changed, 10 insertions, 3 deletions
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html
index 158d666e..26d045d6 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html
@@ -62,6 +62,11 @@
62 "boundObject" : {"@": "tweenRepetition"}, 62 "boundObject" : {"@": "tweenRepetition"},
63 "boundObjectPropertyPath" : "objectAtCurrentIteration.isTweenAnimated", 63 "boundObjectPropertyPath" : "objectAtCurrentIteration.isTweenAnimated",
64 "oneway" : false 64 "oneway" : false
65 },
66 "isClearing" : {
67 "boundObject" : {"@": "tweenRepetition"},
68 "boundObjectPropertyPath" : "objectAtCurrentIteration.isClearing",
69 "oneway" : false
65 } 70 }
66 } 71 }
67 }, 72 },
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
index 55c84dce..43cd7477 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
@@ -377,7 +377,6 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
377 // This needs to move to a keyboard shortcut that is TBD 377 // This needs to move to a keyboard shortcut that is TBD
378 378
379 var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID); 379 var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID);
380 //this.application.ninja.timeline.selectLayer(selectIndex);
381 380
382 if (ev.shiftKey) { 381 if (ev.shiftKey) {
383 if (this.application.ninja.timeline.arrLayers[selectedIndex].elementsList.length == 1) { 382 if (this.application.ninja.timeline.arrLayers[selectedIndex].elementsList.length == 1) {
@@ -533,7 +532,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
533 this.tweens[0].tweenedProperties["top"] = this.animatedElement.offsetTop; 532 this.tweens[0].tweenedProperties["top"] = this.animatedElement.offsetTop;
534 this.tweens[0].tweenedProperties["left"] = this.animatedElement.offsetLeft; 533 this.tweens[0].tweenedProperties["left"] = this.animatedElement.offsetLeft;
535 var animationDuration = Math.round(this.trackDuration / 1000) + "s"; 534 var animationDuration = Math.round(this.trackDuration / 1000) + "s";
536 this.animationName = "animation_" + this.animatedElement.className; 535 this.animationName = "animation_" + this.animatedElement.classList[0];
537 this.ninjaStylesContoller.setElementStyle(this.animatedElement, "-webkit-animation-name", this.animationName); 536 this.ninjaStylesContoller.setElementStyle(this.animatedElement, "-webkit-animation-name", this.animationName);
538 this.ninjaStylesContoller.setElementStyle(this.animatedElement, "-webkit-animation-duration", animationDuration); 537 this.ninjaStylesContoller.setElementStyle(this.animatedElement, "-webkit-animation-duration", animationDuration);
539 this.ninjaStylesContoller.setElementStyle(this.animatedElement, "-webkit-animation-iteration-count", "infinite"); 538 this.ninjaStylesContoller.setElementStyle(this.animatedElement, "-webkit-animation-iteration-count", "infinite");
@@ -553,7 +552,10 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
553 var keyframeString = "@-webkit-keyframes " + this.animationName + " {"; 552 var keyframeString = "@-webkit-keyframes " + this.animationName + " {";
554 553
555 for (var i = 0; i < this.tweens.length; i++) { 554 for (var i = 0; i < this.tweens.length; i++) {
556 var keyframePercent = Math.round((this.tweens[i].keyFrameMillisec / this.trackDuration) * 100) + "%"; 555 var keyMill = parseInt(this.tweens[i].keyFrameMillisec);
556 // TODO - trackDur should be parseFloat rounded to significant digits
557 var trackDur = parseInt(this.trackDuration);
558 var keyframePercent = Math.round((keyMill / trackDur) * 100) + "%";
557 var keyframePropertyString = " " + keyframePercent + " {"; 559 var keyframePropertyString = " " + keyframePercent + " {";
558 keyframePropertyString += "top: " + this.tweens[i].tweenedProperties["top"] + "px;"; 560 keyframePropertyString += "top: " + this.tweens[i].tweenedProperties["top"] + "px;";
559 keyframePropertyString += " left: " + this.tweens[i].tweenedProperties["left"] + "px;"; 561 keyframePropertyString += " left: " + this.tweens[i].tweenedProperties["left"] + "px;";