aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/TimelineTrack.reel
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/Timeline/TimelineTrack.reel')
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js45
1 files changed, 40 insertions, 5 deletions
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
index e00dd0bc..00136c4d 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
@@ -345,6 +345,41 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
345 _styleCollapser:{ 345 _styleCollapser:{
346 value:null 346 value:null
347 }, 347 },
348
349 _trackData:{
350
351 },
352
353 trackData:{
354 serializable:true,
355 get:function(){
356 return this._trackData;
357 },
358 set:function(val){
359 this._trackData = val;
360 this.setData();
361 }
362 },
363
364 setData:{
365 value:function(){
366 this.trackID = this.trackData.layerID;
367 this.tweens = this.trackData.tweens;
368 this.animatedElement = this.trackData.animatedElement;
369 this.arrStyleTracks = this.trackData.arrStyleTracks;
370 this.isTrackAnimated = this.trackData.isTrackAnimated;
371 this.trackDuration = this.trackData.trackDuration;
372 this.animationName = this.trackData.animationName;
373 this.currentKeyframeRule = this.trackData.currentKeyframeRule;
374 this.isMainCollapsed = this.trackData.isMainCollapsed;
375 this.isPositionCollapsed = this.trackData.isPositionCollapsed;
376 this.isTransformCollapsed = this.trackData.isTransformCollapsed;
377 this.bypassAnimation = this.trackData.bypassAnimation;
378 this.isStyleCollapsed = this.trackData.isStyleCollapsed;
379 this.trackPosition = this.trackData.trackPosition;
380 }
381 },
382
348 prepareForDraw:{ 383 prepareForDraw:{
349 value:function () { 384 value:function () {
350 this.init(); 385 this.init();
@@ -378,7 +413,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
378 if(!this.application.ninja.documentController.creatingNewFile){ 413 if(!this.application.ninja.documentController.creatingNewFile){
379 if(this.application.ninja.currentDocument.documentRoot.children[0]){ 414 if(this.application.ninja.currentDocument.documentRoot.children[0]){
380 var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID); 415 var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID);
381 if(!this.application.ninja.timeline.arrLayers[selectedIndex].created){ 416 if(!this.application.ninja.timeline.arrLayers[selectedIndex].layerData.created){
382 this.retrieveStoredTweens(); 417 this.retrieveStoredTweens();
383 } 418 }
384 } 419 }
@@ -394,7 +429,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
394 var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID); 429 var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID);
395 430
396 if (ev.shiftKey) { 431 if (ev.shiftKey) {
397 if (this.application.ninja.timeline.arrLayers[selectedIndex].elementsList.length == 1) { 432 if (this.application.ninja.timeline.arrLayers[selectedIndex].layerData.elementsList.length == 1) {
398 if (this.tweens.length < 1) { 433 if (this.tweens.length < 1) {
399 this.insertTween(0); 434 this.insertTween(0);
400 this.addAnimationRuleToElement(ev); 435 this.addAnimationRuleToElement(ev);
@@ -430,7 +465,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
430 newTween.tweenData = {}; 465 newTween.tweenData = {};
431 466
432 if (clickPos == 0) { 467 if (clickPos == 0) {
433 this.animatedElement = this.application.ninja.timeline.currentLayerSelected.elementsList[0]; 468 this.animatedElement = this.application.ninja.timeline.currentLayerSelected.layerData.elementsList[0];
434 newTween.tweenData.spanWidth = 0; 469 newTween.tweenData.spanWidth = 0;
435 newTween.tweenData.keyFramePosition = 0; 470 newTween.tweenData.keyFramePosition = 0;
436 newTween.tweenData.keyFrameMillisec = 0; 471 newTween.tweenData.keyFrameMillisec = 0;
@@ -472,8 +507,8 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
472 var currentMilliSec,currentMilliSecPerPixel,clickPosition,tempTiming,tempTimingFloat,trackTiming,i = 0; 507 var currentMilliSec,currentMilliSecPerPixel,clickPosition,tempTiming,tempTimingFloat,trackTiming,i = 0;
473 508
474 var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID); 509 var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID);
475 this.application.ninja.timeline.arrLayers[selectedIndex].created=true; 510 this.application.ninja.timeline.arrLayers[selectedIndex].layerData.created=true;
476 this.animatedElement = this.application.ninja.timeline.arrLayers[selectedIndex].elementsList[0]; 511 this.animatedElement = this.application.ninja.timeline.arrLayers[selectedIndex].layerData.elementsList[0];
477 if(this.animatedElement!==undefined){ 512 if(this.animatedElement!==undefined){
478 this.animationName = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-name"); 513 this.animationName = this.application.ninja.stylesController.getElementStyle(this.animatedElement, "-webkit-animation-name");
479 if(this.animationName){ 514 if(this.animationName){