diff options
-rw-r--r-- | js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js | 40 | ||||
-rw-r--r-- | js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 42 |
2 files changed, 0 insertions, 82 deletions
diff --git a/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js b/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js index 9971933f..c75e105d 100644 --- a/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js +++ b/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js | |||
@@ -302,46 +302,6 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, { | |||
302 | } | 302 | } |
303 | }, | 303 | }, |
304 | 304 | ||
305 | splitPropTween:{ | ||
306 | value:function (ev) { | ||
307 | console.log("splitting sub prop tween with new keyframe"); | ||
308 | var clickPos = ev.target.parentElement.offsetLeft + ev.offsetX; | ||
309 | var i; | ||
310 | var tweensLength = this.propTweens.length - 1; | ||
311 | var prevTween, nextTween, splitTweenIndex; | ||
312 | for (i = 0; i < tweensLength; i++) { | ||
313 | prevTween = this.propTweens[i].tweenData.keyFramePosition; | ||
314 | nextTween = this.propTweens[i + 1].tweenData.keyFramePosition; | ||
315 | if (clickPos > prevTween && clickPos < nextTween) { | ||
316 | //console.log(clickPos + " found on tween: "+ this.tweens[i+1].tweenData.tweenID); | ||
317 | splitTweenIndex = this.propTweens[i + 1].tweenData.tweenID; | ||
318 | this.propTweens[i + 1].tweenData.spanWidth = this.propTweens[i + 1].tweenData.keyFramePosition - clickPos; | ||
319 | this.propTweens[i + 1].tweenData.spanPosition = ev.target.parentElement.offsetLeft + ev.offsetX; | ||
320 | if (ev.target.className != "tween-span") { | ||
321 | // don't set styles on timeline track if event is coming from the track | ||
322 | } else { | ||
323 | ev.target.style.width = this.propTweens[i + 1].tweenData.spanWidth + "px"; | ||
324 | ev.target.parentElement.style.left = clickPos + "px"; | ||
325 | ev.target.parentElement.children[1].style.left = (this.propTweens[i + 1].tweenData.spanWidth - 3) + "px"; | ||
326 | } | ||
327 | var newTweenToInsert = {}; | ||
328 | newTweenToInsert.tweenData = {}; | ||
329 | newTweenToInsert.tweenData.spanWidth = clickPos - prevTween; | ||
330 | newTweenToInsert.tweenData.keyFramePosition = clickPos; | ||
331 | newTweenToInsert.tweenData.keyFrameMillisec = Math.floor(this.application.ninja.timeline.millisecondsOffset / 80) * clickPos; | ||
332 | newTweenToInsert.tweenData.tweenID = splitTweenIndex - 1; | ||
333 | newTweenToInsert.tweenData.spanPosition = clickPos - newTweenToInsert.tweenData.spanWidth; | ||
334 | newTweenToInsert.tweenData.tweenedProperties = []; | ||
335 | newTweenToInsert.tweenData.tweenedProperties[this.trackEditorProperty] = this.ninjaStylesContoller.getElementStyle(this.animatedElement, this.trackEditorProperty); | ||
336 | this.propTweens.splice(splitTweenIndex, 0, newTweenToInsert); | ||
337 | break; | ||
338 | } | ||
339 | } | ||
340 | this.application.ninja.currentDocument.model.needsSave = true; | ||
341 | } | ||
342 | }, | ||
343 | |||
344 | // splitTweenAt: Split a tween at a particular position (x coordinate) | ||
345 | splitPropTweenAt:{ | 305 | splitPropTweenAt:{ |
346 | value:function (position) { | 306 | value:function (position) { |
347 | var i, j, nextComponentIndex, | 307 | var i, j, nextComponentIndex, |
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) { |