From 85dfdc9d46847d5fdd1b6fc6aaf35e93b09e9935 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Fri, 15 Jun 2012 00:28:24 -0700 Subject: F6 support for keyframes Signed-off-by: Jonathan Duran --- .../Timeline/TimelineTrack.reel/TimelineTrack.js | 41 +++++++++++++--------- 1 file changed, 24 insertions(+), 17 deletions(-) (limited to 'js/panels/Timeline/TimelineTrack.reel') diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index 6d557845..11c27ce3 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -649,25 +649,32 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { // This needs to move to a keyboard shortcut that is TBD var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID); if (ev.shiftKey) { - //if (this.application.ninja.timeline.arrLayers[selectedIndex].layerData.elementsList.length == 1) { - if (this.tweens.length < 1) { - this.insertTween(0); - this.addAnimationRuleToElement(ev); + if (this.tweens.length < 1) { + this.insertTween(0); + this.addAnimationRuleToElement(ev); + this.updateKeyframeRule(); + } else { + if (ev.target.className === "tracklane") { + this.handleNewTween(ev); + this.updateKeyframeRule(); + } else if (ev.target.className === "tween_span" && ev.target.parentElement.parentElement.className === "tracklane") { + this.handleNewTween(ev); this.updateKeyframeRule(); - } else { - //console.log(ev); - if (ev.target.className === "tracklane") { - this.handleNewTween(ev); - this.updateKeyframeRule(); - } else if (ev.target.className === "tween_span" && ev.target.parentElement.parentElement.className === "tracklane"){ - this.handleNewTween(ev); - this.updateKeyframeRule(); - } } - //} else { - // TEMP error check - //console.log("There must be exactly one element in an animated layer."); - //} + } + } + } + }, + + handleKeyboardShortcut:{ + value:function(ev){ + if (this.tweens.length < 1) { + this.insertTween(0); + this.addAnimationRuleToElement(ev); + this.updateKeyframeRule(); + } else { + this.handleNewTween(ev); + this.updateKeyframeRule(); } } }, -- cgit v1.2.3