aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/TimelineTrack.reel
diff options
context:
space:
mode:
authorJonathan Duran2012-02-09 09:09:01 -0800
committerJonathan Duran2012-02-09 09:09:01 -0800
commit112ba5f5beea03010d40a53a64bfa9595e0faa88 (patch)
treee23d48f682f6b857f07c531de0fde4fc9c1b706b /js/panels/Timeline/TimelineTrack.reel
parentfc7638f3921595f9a0cb0bd1687caf5451a7dd4d (diff)
downloadninja-112ba5f5beea03010d40a53a64bfa9595e0faa88.tar.gz
Cleaning up more code and adding more models for timeline
Signed-off-by: Jonathan Duran <jduran@motorola.com>
Diffstat (limited to 'js/panels/Timeline/TimelineTrack.reel')
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
index f9d3ad6b..dde01a2c 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
@@ -173,7 +173,6 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
173 this.ninjaStylesContoller = this.application.ninja.stylesController; 173 this.ninjaStylesContoller = this.application.ninja.stylesController;
174 this.track_lane.addEventListener("click", this, false); 174 this.track_lane.addEventListener("click", this, false);
175 this.keyFramePropertyData = new Array(); 175 this.keyFramePropertyData = new Array();
176 //this.insertTween(0);
177 } 176 }
178 }, 177 },
179 178
@@ -202,9 +201,10 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
202 if (this.application.ninja.timeline.arrLayers[this.trackID - 1].element.length == 1) { 201 if (this.application.ninja.timeline.arrLayers[this.trackID - 1].element.length == 1) {
203 if (this.tweens.length < 1) { 202 if (this.tweens.length < 1) {
204 this.insertTween(0); 203 this.insertTween(0);
205 this.addAnimationRuleToElement(); 204 this.addAnimationRuleToElement(ev);
205 } else {
206 this.handleNewTween(ev);
206 } 207 }
207 this.handleNewTween(ev);
208 } else { 208 } else {
209 alert("There must be exactly one element in an animated layer.") 209 alert("There must be exactly one element in an animated layer.")
210 } 210 }
@@ -266,12 +266,13 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
266 266
267 splitTween:{ 267 splitTween:{
268 value:function (ev) { 268 value:function (ev) {
269 console.log("splitting tween at span offsetX: " + ev.offsetX); 269 alert("Splitting an existing span with a new keyframe is not yet supported.")
270 //console.log("splitting tween at span offsetX: " + ev.offsetX);
270 } 271 }
271 }, 272 },
272 273
273 addAnimationRuleToElement:{ 274 addAnimationRuleToElement:{
274 value:function () { 275 value:function (tweenEvent) {
275 var theElement = this.application.ninja.timeline.arrLayers[this.trackID - 1].element[0]; 276 var theElement = this.application.ninja.timeline.arrLayers[this.trackID - 1].element[0];
276 this.animatedElement = theElement; 277 this.animatedElement = theElement;
277 278
@@ -293,6 +294,8 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
293 this.currentKeyframeRule = this.ninjaStylesContoller.addRule(initRule); 294 this.currentKeyframeRule = this.ninjaStylesContoller.addRule(initRule);
294 295
295 this.isAnimated = true; 296 this.isAnimated = true;
297
298 this.insertTween(tweenEvent.offsetX);
296 } 299 }
297 }, 300 },
298 301