aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
diff options
context:
space:
mode:
authorJon Reid2012-03-01 18:01:08 -0800
committerJon Reid2012-03-01 18:01:08 -0800
commit205d869d94005cb214fd838879d4f5e81d763311 (patch)
tree2501c3a37f8ec2a19d179c24ca34e4f9df640677 /js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
parent28befbc159399f70f00034f52e56a60dae0a3ba1 (diff)
downloadninja-205d869d94005cb214fd838879d4f5e81d763311.tar.gz
Timeline: Merge arrlayers and arrtracks into one object.
Redefine collapser to use property binding instead of events.
Diffstat (limited to 'js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js')
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js95
1 files changed, 91 insertions, 4 deletions
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
index 74a7f962..a10cb4d8 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js
@@ -33,16 +33,16 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
33 33
34 // Are the various collapsers collapsed or not 34 // Are the various collapsers collapsed or not
35 _isMainCollapsed:{ 35 _isMainCollapsed:{
36 value:"" 36 value: true
37 }, 37 },
38 isMainCollapsed:{ 38 isMainCollapsed:{
39 get:function () { 39 get:function () {
40 return this._isMainCollapsed; 40 return this._isMainCollapsed;
41 }, 41 },
42 set:function (newVal) { 42 set:function (newVal) {
43 this.log('TimelineTrack.js: isMainCollapsed: ', newVal);
43 if (newVal !== this._isMainCollapsed) { 44 if (newVal !== this._isMainCollapsed) {
44 this._isMainCollapsed = newVal; 45 this._isMainCollapsed = newVal;
45 this.needsDraw = true;
46 } 46 }
47 47
48 } 48 }
@@ -89,6 +89,19 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
89 } 89 }
90 } 90 }
91 }, 91 },
92 _animateCollapser : {
93 serializable: true,
94 value: false
95 },
96 animateCollapser : {
97 serializable: true,
98 get: function() {
99 return this._animateCollapser;
100 },
101 set: function(newVal) {
102 this._animateCollapser = newVal;
103 }
104 },
92 105
93 _arrStyleTracks : { 106 _arrStyleTracks : {
94 serializable:true, 107 serializable:true,
@@ -345,6 +358,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
345 draw:{ 358 draw:{
346 value:function () { 359 value:function () {
347 this.ninjaStylesContoller = this.application.ninja.stylesController; 360 this.ninjaStylesContoller = this.application.ninja.stylesController;
361 return;
348 if (this._mainCollapser.isCollapsed !== this.isMainCollapsed) { 362 if (this._mainCollapser.isCollapsed !== this.isMainCollapsed) {
349 this._mainCollapser.toggle(false); 363 this._mainCollapser.toggle(false);
350 } 364 }
@@ -450,7 +464,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
450 splitTween:{ 464 splitTween:{
451 value:function (ev) { 465 value:function (ev) {
452 alert("Splitting an existing span with a new keyframe is not yet supported."); 466 alert("Splitting an existing span with a new keyframe is not yet supported.");
453 //console.log("splitting tween at span offsetX: " + ev.offsetX); 467 //this.log("splitting tween at span offsetX: " + ev.offsetX);
454 } 468 }
455 }, 469 },
456 470
@@ -589,9 +603,25 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
589 this._mainCollapser.element = this.myContent; 603 this._mainCollapser.element = this.myContent;
590 this._mainCollapser.isCollapsed = this.isMainCollapsed; 604 this._mainCollapser.isCollapsed = this.isMainCollapsed;
591 this._mainCollapser.isAnimated = true; 605 this._mainCollapser.isAnimated = true;
606 Object.defineBinding(this._mainCollapser, "isToggling", {
607 boundObject: this,
608 boundObjectPropertyPath: "isMainCollapsed",
609 oneway: false
610 });
611 Object.defineBinding(this._mainCollapser, "bypassAnimation", {
612 boundObject: this,
613 boundObjectPropertyPath: "animateCollapser",
614 oneway: false,
615 boundValueMutator: function(value) {
616 return !value;
617 }
618 });
619
620 /*
592 this._mainCollapser.labelClickEvent = function () { 621 this._mainCollapser.labelClickEvent = function () {
593 that.isMainCollapsed = that._mainCollapser.isCollapsed; 622 that.isMainCollapsed = that._mainCollapser.isCollapsed;
594 }; 623 };
624 */
595 //this._mainCollapser.needsDraw = true; 625 //this._mainCollapser.needsDraw = true;
596 626
597 this._positionCollapser = Collapser.create(); 627 this._positionCollapser = Collapser.create();
@@ -602,9 +632,18 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
602 this._positionCollapser.element = this.contentPosition; 632 this._positionCollapser.element = this.contentPosition;
603 this._positionCollapser.isCollapsed = this.isPositionCollapsed; 633 this._positionCollapser.isCollapsed = this.isPositionCollapsed;
604 this._positionCollapser.isAnimated = true; 634 this._positionCollapser.isAnimated = true;
635 Object.defineBinding(this._positionCollapser, "isToggling", {
636 boundObject: this,
637 boundObjectPropertyPath: "isPositionCollapsed",
638 oneway: false
639 });
640
641
642 /*
605 this._positionCollapser.labelClickEvent = function () { 643 this._positionCollapser.labelClickEvent = function () {
606 that.isPositionCollapsed = that._positionCollapser.isCollapsed; 644 that.isPositionCollapsed = that._positionCollapser.isCollapsed;
607 }; 645 };
646 */
608 //this._positionCollapser.needsDraw = true; 647 //this._positionCollapser.needsDraw = true;
609 648
610 this._transformCollapser = Collapser.create(); 649 this._transformCollapser = Collapser.create();
@@ -615,9 +654,18 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
615 this._transformCollapser.element = this.contentTransform; 654 this._transformCollapser.element = this.contentTransform;
616 this._transformCollapser.isCollapsed = this.isTransformCollapsed; 655 this._transformCollapser.isCollapsed = this.isTransformCollapsed;
617 this._transformCollapser.isAnimated = true; 656 this._transformCollapser.isAnimated = true;
657 Object.defineBinding(this._transformCollapser, "isToggling", {
658 boundObject: this,
659 boundObjectPropertyPath: "isTransformCollapsed",
660 oneway: false
661 });
662
663
664 /*
618 this._transformCollapser.labelClickEvent = function () { 665 this._transformCollapser.labelClickEvent = function () {
619 that.isTransformCollapsed = that._transformCollapser.isCollapsed; 666 that.isTransformCollapsed = that._transformCollapser.isCollapsed;
620 }; 667 };
668 */
621 //this._transformCollapser.needsDraw = true; 669 //this._transformCollapser.needsDraw = true;
622 670
623 this._styleCollapser = Collapser.create(); 671 this._styleCollapser = Collapser.create();
@@ -628,13 +676,22 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
628 this._styleCollapser.element = this.contentStyles; 676 this._styleCollapser.element = this.contentStyles;
629 this._styleCollapser.isCollapsed = this.isStyleCollapsed; 677 this._styleCollapser.isCollapsed = this.isStyleCollapsed;
630 this._styleCollapser.isAnimated = true; 678 this._styleCollapser.isAnimated = true;
679 Object.defineBinding(this._styleCollapser, "isToggling", {
680 boundObject: this,
681 boundObjectPropertyPath: "isStyleCollapsed",
682 oneway: false
683 });
684
685
686 /*
631 this._styleCollapser.labelClickEvent = function () { 687 this._styleCollapser.labelClickEvent = function () {
632 that.isStyleCollapsed = that._styleCollapser.isCollapsed; 688 that.isStyleCollapsed = that._styleCollapser.isCollapsed;
633 }; 689 };
690 */
634 //this._styleCollapser.needsDraw = true; 691 //this._styleCollapser.needsDraw = true;
635 692
636 // Register event handler for layer events. 693 // Register event handler for layer events.
637 defaultEventManager.addEventListener("layerEvent", this, false); 694 //defaultEventManager.addEventListener("layerEvent", this, false);
638 695
639 } 696 }
640 }, 697 },
@@ -668,5 +725,35 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, {
668 this.arrStyleTracks.pop(); 725 this.arrStyleTracks.pop();
669 } 726 }
670 } 727 }
728 },
729 /* Begin: Logging routines */
730 _boolDebug: {
731 enumerable: false,
732 value: false // set to true to enable debugging to console; false for turning off all debugging.
733 },
734 boolDebug: {
735 get: function() {
736 return this._boolDebug;
737 },
738 set: function(boolDebugSwitch) {
739 this._boolDebug = boolDebugSwitch;
740 }
741 },
742 log: {
743 value: function(strMessage) {
744 if (this.boolDebug) {
745 console.log(this.getLineNumber() + ": " + strMessage);
746 }
747 }
748 },
749 getLineNumber: {
750 value: function() {