From 47b025b90af2a5d43dddf3b41f8c96fd26c3e4f1 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Sat, 25 Feb 2012 16:26:31 -0800 Subject: Timeline : Adding Tweens Properties Signed-off-by: Kruti Shah Signed-off-by: Jonathan Duran --- js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'js/panels') diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index 30280727..d837997a 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -462,7 +462,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { retrieveStoredTweens:{ value:function () { - var percentValue, fraction, splitValue, i = 0; + var percentValue, fraction, splitValue,offsetAttribute,topOffSetAttribute,leftOffsetAttribute, i = 0; this.animatedElement = this.application.ninja.timeline.arrLayers[this.trackID - 1].elementsList[0]; this.animationName = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-name"); @@ -478,12 +478,22 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { while (this.currentKeyframeRule[i]) { var newTween = {}; + offsetAttribute = this.currentKeyframeRule[i].cssText.split(" "); + topOffSetAttribute = offsetAttribute[3].split("px"); + leftOffsetAttribute = offsetAttribute[5].split("px"); + + parseInt(topOffSetAttribute[0]); + parseInt(leftOffsetAttribute[0]); + if (this.currentKeyframeRule[i].keyText === "0%") { newTween.spanWidth = 0; newTween.keyFramePosition = 0; newTween.keyFrameMillisec = 0; newTween.tweenID = 0; newTween.spanPosition = 0; + newTween.tweenedProperties = []; + newTween.tweenedProperties["top"] = topOffSetAttribute[0]; + newTween.tweenedProperties["left"] = leftOffsetAttribute[0]; this.tweens.push(newTween); } @@ -499,6 +509,9 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { newTween.keyFrameMillisec = this.currentMilliSec; newTween.tweenID = this.nextKeyframe; newTween.spanPosition = this.clickPos - newTween.spanWidth; + newTween.tweenedProperties=[]; + newTween.tweenedProperties["top"] = topOffSetAttribute[0]; + newTween.tweenedProperties["left"] = leftOffsetAttribute[0]; this.tweens.push(newTween); -- cgit v1.2.3