aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js')
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js60
1 files changed, 47 insertions, 13 deletions
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
index c6b67c9c..601788ad 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
@@ -26,8 +26,9 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
26 return this._trackID; 26 return this._trackID;
27 }, 27 },
28 set:function (value) { 28 set:function (value) {
29 this._trackID = value; 29 if (value !== this._trackID) {
30 //this.needsDraw = true; 30 this._trackID = value;
31 }
31 } 32 }
32 }, 33 },
33 34
@@ -40,11 +41,9 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
40 return this._isMainCollapsed; 41 return this._isMainCollapsed;
41 }, 42 },
42 set:function (newVal) { 43 set:function (newVal) {
43 this.log('TimelineTrack.js: isMainCollapsed: ', newVal);
44 if (newVal !== this._isMainCollapsed) { 44 if (newVal !== this._isMainCollapsed) {
45 this._isMainCollapsed = newVal; 45 this._isMainCollapsed = newVal;
46 } 46 }
47
48 } 47 }
49 }, 48 },
50 _isTransformCollapsed:{ 49 _isTransformCollapsed:{
@@ -96,8 +95,12 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
96 return this._bypassAnimation; 95 return this._bypassAnimation;
97 }, 96 },
98 set: function(newVal) { 97 set: function(newVal) {
99 //console.log("timelinetrack bypassAnimation setter " + newVal) 98 if (newVal !== this._bypassAnimation) {
100 this._bypassAnimation = newVal; 99 this._bypassAnimation = newVal;
100 }
101 if (this.trackData.bypassAnimation !== newVal) {
102 this.trackData.bypassAnimation = newVal;
103 }
101 } 104 }
102 }, 105 },
103 106
@@ -299,11 +302,11 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
299 } 302 }
300 }, 303 },
301 304
305 // should be unneeded with one element per layer restriction
302 _animatedElement:{ 306 _animatedElement:{
303 serializable:true, 307 serializable:true,
304 value:null 308 value:null
305 }, 309 },
306
307 animatedElement:{ 310 animatedElement:{
308 serializable:true, 311 serializable:true,
309 get:function () { 312 get:function () {
@@ -347,7 +350,8 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
347 }, 350 },
348 351
349 _trackData:{ 352 _trackData:{
350 353 serializable: true,
354 value: false
351 }, 355 },
352 356
353 trackData:{ 357 trackData:{
@@ -358,16 +362,21 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
358 set:function(val){ 362 set:function(val){
359 this._trackData = val; 363 this._trackData = val;
360 if(this._trackData){ 364 if(this._trackData){
361 this.setData(); 365 this.setData();
362 } 366 }
363 } 367 }
364 }, 368 },
369
370 _setDataTimestamp : {
371 value: false
372 },
365 373
366 setData:{ 374 setData:{
367 value:function(){ 375 value:function(){
376 this.bypassAnimation = this.trackData.bypassAnimation;
368 this.trackID = this.trackData.layerID; 377 this.trackID = this.trackData.layerID;
369 this.tweens = this.trackData.tweens; 378 this.tweens = this.trackData.tweens;
370 this.animatedElement = this.trackData.animatedElement; 379 this.animatedElement = this.trackData.animatedElement; // unneeded with one element per layer restriction
371 this.arrStyleTracks = this.trackData.arrStyleTracks; 380 this.arrStyleTracks = this.trackData.arrStyleTracks;
372 this.isTrackAnimated = this.trackData.isTrackAnimated; 381 this.isTrackAnimated = this.trackData.isTrackAnimated;
373 this.trackDuration = this.trackData.trackDuration; 382 this.trackDuration = this.trackData.trackDuration;
@@ -376,12 +385,39 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
376 this.isMainCollapsed = this.trackData.isMainCollapsed; 385 this.isMainCollapsed = this.trackData.isMainCollapsed;
377 this.isPositionCollapsed = this.trackData.isPositionCollapsed; 386 this.isPositionCollapsed = this.trackData.isPositionCollapsed;
378 this.isTransformCollapsed = this.trackData.isTransformCollapsed; 387 this.isTransformCollapsed = this.trackData.isTransformCollapsed;
379 this.bypassAnimation = this.trackData.bypassAnimation;
380 this.isStyleCollapsed = this.trackData.isStyleCollapsed; 388 this.isStyleCollapsed = this.trackData.isStyleCollapsed;
381 this.trackPosition = this.trackData.trackPosition; 389 this.trackPosition = this.trackData.trackPosition;
382 this.needsDraw = true; 390 this.needsDraw = true;
383 } 391 }
384 }, 392 },
393
394 // Data binding observation point and trigger method
395 _bindingPoint : {
396 serializable: true,
397 value : {}
398 },
399 bindingPoint: {
400 serializable: true,
401 get: function() {
402 return this._bindingPoint;
403 },
404 set: function(newVal) {
405 if (newVal !== this._bindingPoint) {
406 this._bindingPoint = newVal;
407 this.setData();
408 }
409 }
410 },
411
412 triggerOutgoingBinding : {
413 value: function() {
414 if (this.trackData.triggerBinding === true) {
415 this.trackData.triggerBinding = false;
416 } else {
417 this.trackData.triggerBinding = true;
418 }
419 }
420 },
385 421
386 prepareForDraw:{ 422 prepareForDraw:{
387 value:function () { 423 value:function () {
@@ -418,9 +454,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
418 value:function (ev) { 454 value:function (ev) {
419 // TEMP - if the SHIFT key is down, add a new keyframe or split an existing span 455 // TEMP - if the SHIFT key is down, add a new keyframe or split an existing span
420 // This needs to move to a keyboard shortcut that is TBD 456 // This needs to move to a keyboard shortcut that is TBD
421
422 var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID); 457 var selectedIndex = this.application.ninja.timeline.getLayerIndexByID(this.trackID);
423
424 if (ev.shiftKey) { 458 if (ev.shiftKey) {
425 if (this.application.ninja.timeline.arrLayers[selectedIndex].layerData.elementsList.length == 1) { 459 if (this.application.ninja.timeline.arrLayers[selectedIndex].layerData.elementsList.length == 1) {
426 if (this.tweens.length < 1) { 460 if (this.tweens.length < 1) {