From 156b0648c6b046f74303221ce632a49fb28c9a8a Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Tue, 7 Feb 2012 07:50:50 -0800 Subject: Hookup track animations to layer element Signed-off-by: Jonathan Duran --- js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js') diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index 13529115..5b1354d2 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -199,11 +199,16 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { // TEMP - if the SHIFT key is down, add a new keyframe or split an existing span // This needs to move to a keyboard shortcut that is TBD if (ev.shiftKey) { - if (this.tweens.length < 1) { - this.addAnimationRuleToElement(); - this.insertTween(0); + if(this.application.ninja.timeline.arrLayers[this.trackID - 1].element.length == 1){ + if (this.tweens.length < 1) { + this.addAnimationRuleToElement(); + this.insertTween(0); + } + this.handleNewTween(ev); + } else { + alert("There much be only one element in an animated layer.") } - this.handleNewTween(ev); + } } }, @@ -268,7 +273,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { addAnimationRuleToElement:{ value: function(){ - var theElement = this.application.ninja.currentDocument._document.getElementById(this.application.ninja.timeline.arrLayers[this.trackID - 1].layerName); + var theElement = this.application.ninja.timeline.arrLayers[this.trackID - 1].element[0]; this.animatedElement = theElement; var initAnimatedProperties = new Array(); -- cgit v1.2.3