diff options
Diffstat (limited to 'js/panels/Timeline/PropertyTrack.reel')
-rw-r--r-- | js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js | 40 |
1 files changed, 0 insertions, 40 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, |