aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/TimelineTrack.reel
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/Timeline/TimelineTrack.reel')
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js42
1 files changed, 0 insertions, 42 deletions
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
index 1a8b6f4e..bf380e00 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
@@ -811,48 +811,6 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
811 } 811 }
812 }, 812 },
813 813
814 splitTween:{
815 value:function (ev) {
816 var clickPos = ev.target.parentElement.offsetLeft + ev.offsetX,
817 i,
818 tweensLength = this.tweens.length-1,
819 prevTween, nextTween, splitTweenIndex;
820
821 for(i=0; i<tweensLength; i++){
822 prevTween = this.tweens[i].tweenData.keyFramePosition;
823 nextTween = this.tweens[i+1].tweenData.keyFramePosition;
824 if(clickPos > prevTween && clickPos < nextTween){
825 //console.log(clickPos + " found on tween: "+ this.tweens[i+1].tweenData.tweenID);
826 splitTweenIndex = this.tweens[i+1].tweenData.tweenID;
827 this.tweens[i+1].tweenData.spanWidth = this.tweens[i+1].tweenData.keyFramePosition - clickPos;
828 this.tweens[i+1].tweenData.spanPosition = ev.target.parentElement.offsetLeft + ev.offsetX;
829 if (ev.target.className != "tween-span") {
830 // don't set styles on timeline track if event is coming from the track
831 } else {
832 ev.target.style.width = this.tweens[i + 1].tweenData.spanWidth + "px";
833 ev.target.parentElement.style.left = clickPos + "px";
834 ev.target.parentElement.children[1].style.left = (this.tweens[i + 1].tweenData.spanWidth - 3) + "px";
835 }
836 var newTweenToInsert = {};
837 newTweenToInsert.tweenData = {};
838 newTweenToInsert.tweenData.spanWidth = clickPos - prevTween;
839 newTweenToInsert.tweenData.keyFramePosition = clickPos;
840 newTweenToInsert.tweenData.keyFrameMillisec = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80) * clickPos;
841 newTweenToInsert.tweenData.tweenID = splitTweenIndex - 1;
842 newTweenToInsert.tweenData.spanPosition = clickPos - newTweenToInsert.tweenData.spanWidth;
843 newTweenToInsert.tweenData.tweenedProperties = [];
844 newTweenToInsert.tweenData.tweenedProperties["top"] = this.animatedElement.offsetTop + "px";
845 newTweenToInsert.tweenData.tweenedProperties["left"] = this.animatedElement.offsetLeft + "px";
846 newTweenToInsert.tweenData.tweenedProperties["width"] = this.animatedElement.offsetWidth + "px";
847 newTweenToInsert.tweenData.tweenedProperties["height"] = this.animatedElement.offsetHeight + "px";
848 this.tweens.splice(splitTweenIndex, 0, newTweenToInsert);
849 break;
850 }
851 }
852 this.application.ninja.currentDocument.model.needsSave = true;
853 }
854 },
855
856 // splitTweenAt: Split a tween at a particular position (x coordinate) 814 // splitTweenAt: Split a tween at a particular position (x coordinate)
857 splitTweenAt: { 815 splitTweenAt: {
858 value:function (position) { 816 value:function (position) {