aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js')
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js24
1 files changed, 20 insertions, 4 deletions
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
index 0c5121cd..a36e666b 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
@@ -462,9 +462,10 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
462 462
463 retrieveStoredTweens:{ 463 retrieveStoredTweens:{
464 value:function () { 464 value:function () {
465 var percentValue, fraction, splitValue, i = 0; 465 var percentValue, fraction, splitValue,offsetAttribute,topOffSetAttribute,leftOffsetAttribute, i = 0;
466 466
467 this.animatedElement = this.application.ninja.timeline.arrLayers[this.trackID - 1].elementsList[0]; 467 var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID);
468 this.animatedElement = this.application.ninja.timeline.arrLayers[selectedIndex].elementsList[0];
468 this.animationName = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-name"); 469 this.animationName = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-name");
469 this.animationDuration = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-duration"); 470 this.animationDuration = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-duration");
470 if(this.animationDuration){ 471 if(this.animationDuration){
@@ -478,12 +479,22 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
478 while (this.currentKeyframeRule[i]) { 479 while (this.currentKeyframeRule[i]) {
479 var newTween = {}; 480 var newTween = {};
480 481
482 offsetAttribute = this.currentKeyframeRule[i].cssText.split(" ");
483 topOffSetAttribute = offsetAttribute[3].split("px");
484 leftOffsetAttribute = offsetAttribute[5].split("px");
485
486 parseInt(topOffSetAttribute[0]);
487 parseInt(leftOffsetAttribute[0]);
488
481 if (this.currentKeyframeRule[i].keyText === "0%") { 489 if (this.currentKeyframeRule[i].keyText === "0%") {
482 newTween.spanWidth = 0; 490 newTween.spanWidth = 0;
483 newTween.keyFramePosition = 0; 491 newTween.keyFramePosition = 0;
484 newTween.keyFrameMillisec = 0; 492 newTween.keyFrameMillisec = 0;
485 newTween.tweenID = 0; 493 newTween.tweenID = 0;
486 newTween.spanPosition = 0; 494 newTween.spanPosition = 0;
495 newTween.tweenedProperties = [];
496 newTween.tweenedProperties["top"] = topOffSetAttribute[0];
497 newTween.tweenedProperties["left"] = leftOffsetAttribute[0];
487 this.tweens.push(newTween); 498 this.tweens.push(newTween);
488 499
489 } 500 }
@@ -499,6 +510,9 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
499 newTween.keyFrameMillisec = this.currentMilliSec; 510 newTween.keyFrameMillisec = this.currentMilliSec;
500 newTween.tweenID = this.nextKeyframe; 511 newTween.tweenID = this.nextKeyframe;
501 newTween.spanPosition = this.clickPos - newTween.spanWidth; 512 newTween.spanPosition = this.clickPos - newTween.spanWidth;
513 newTween.tweenedProperties=[];
514 newTween.tweenedProperties["top"] = topOffSetAttribute[0];
515 newTween.tweenedProperties["left"] = leftOffsetAttribute[0];
502 this.tweens.push(newTween); 516 this.tweens.push(newTween);
503 517
504 518
@@ -556,7 +570,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
556 value:function () { 570 value:function () {
557 var that = this; 571 var that = this;
558 572
559 this.arrPositionTracks = [0, 1, 2]; 573 this.arrPositionTracks = [0, 1];
560 this.arrTransformTracks = [0, 1, 2, 3, 4]; 574 this.arrTransformTracks = [0, 1, 2, 3, 4];
561 575
562 this.label = this.element.querySelector(".label-main"); 576 this.label = this.element.querySelector(".label-main");
@@ -652,7 +666,9 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
652 this._styleCollapser.bypassAnimation = layerEvent.bypassAnimation; 666 this._styleCollapser.bypassAnimation = layerEvent.bypassAnimation;
653 this._styleCollapser.handleCollapserLabelClick(); 667 this._styleCollapser.handleCollapserLabelClick();
654 } 668 }
669 } else if (layerEvent.layerEventType === "deleteStyle") {
670 this.arrStyleTracks.pop();
655 } 671 }
656 } 672 }
657 } 673 }
658}); \ No newline at end of file 674});