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/TimelinePanel.reel/TimelinePanel.js | 10 ++++++ .../Timeline/TimelineTrack.reel/TimelineTrack.js | 41 +++++++++++++--------- 2 files changed, 34 insertions(+), 17 deletions(-) (limited to 'js/panels/Timeline') diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index b022bd8a..7f8d421d 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -905,6 +905,16 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { } }, + handleKeyframeShortcut:{ + value:function(){ + //console.log(this.currentLayersSelected); + //console.log(this.trackRepetition); + var tempEv = {}; + tempEv.offsetX = this.playheadmarker.offsetLeft; + this.trackRepetition.childComponents[this.currentLayersSelected[0]].handleKeyboardShortcut(tempEv); + } + }, + updateTrackContainerWidth:{ value:function () { this.container_tracks.style.width = (this.end_hottext.value * 80) + "px"; 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