aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline
diff options
context:
space:
mode:
authorJonathan Duran2012-05-04 02:21:58 -0700
committerJonathan Duran2012-05-04 02:21:58 -0700
commit16f95cb8c70608eeede6c9e0834b184ade6c7752 (patch)
tree588c942866e811e656107006ec5ee30f14ef62e3 /js/panels/Timeline
parent54fd77320dcce93987c138923bcb8a9b9899c4c0 (diff)
downloadninja-16f95cb8c70608eeede6c9e0834b184ade6c7752.tar.gz
update data bindings for subproperty tracks
Signed-off-by: Jonathan Duran <jduran@motorola.com>
Diffstat (limited to 'js/panels/Timeline')
-rw-r--r--js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js54
-rw-r--r--js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html9
2 files changed, 60 insertions, 3 deletions
diff --git a/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js b/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js
index 8f7745e5..83d4ce73 100644
--- a/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js
+++ b/js/panels/Timeline/PropertyTrack.reel/PropertyTrack.js
@@ -16,6 +16,8 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, {
16 prepareForDraw:{ 16 prepareForDraw:{
17 value:function(){ 17 value:function(){
18 this.element.addEventListener("click", this, false); 18 this.element.addEventListener("click", this, false);
19 this.trackID = this.parentComponent.parentComponent.parentComponent.trackID;
20 this.animatedElement = this.parentComponent.parentComponent.parentComponent.animatedElement;
19 } 21 }
20 }, 22 },
21 23
@@ -29,6 +31,10 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, {
29 value:null 31 value:null
30 }, 32 },
31 33
34 animatedElement:{
35 value:null
36 },
37
32 propTweenRepetition:{ 38 propTweenRepetition:{
33 serializable:true, 39 serializable:true,
34 get:function () { 40 get:function () {
@@ -53,10 +59,56 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, {
53 } 59 }
54 }, 60 },
55 61
62 _propTrackData:{
63 value:false
64 },
65
66 propTrackData:{
67 get:function () {
68 return this._propTrackData;
69 },
70 set:function (val) {
71 this._propTrackData = val;
72 if (this._propTrackData) {
73 this.setData();
74 }
75 }
76 },
77
78 setData:{
79 value:function(){
80 if (typeof(this.propTrackData) === "undefined") {
81 return;
82 }
83
84
85 this.propTweens = this.propTrackData.propTweens;
86
87 this.needsDraw = true;
88 }
89 },
90
56 nextKeyframe:{ 91 nextKeyframe:{
57 value:1 92 value:1
58 }, 93 },
59 94
95 _trackID:{
96 value:null
97 },
98
99 trackID:{
100 serializable:true,
101 get:function () {
102 return this._trackID;
103 },
104 set:function (value) {
105 if (value !== this._trackID) {
106 this._trackID = value;
107 this.propTrackData.layerID = value;
108 }
109 }
110 },
111
60 handleClick:{ 112 handleClick:{
61 value:function(ev){ 113 value:function(ev){
62 var parentTrackID = this.parentComponent.parentComponent.parentComponent.trackID; 114 var parentTrackID = this.parentComponent.parentComponent.parentComponent.trackID;
@@ -126,9 +178,7 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, {
126 178
127 addPropAnimationRuleToElement:{ 179 addPropAnimationRuleToElement:{
128 value:function(tweenEvent){ 180 value:function(tweenEvent){
129 console.log("SECOND PROP TWEEN ADDING at " + tweenEvent.offsetX);
130 this.insertPropTween(tweenEvent.offsetX); 181 this.insertPropTween(tweenEvent.offsetX);
131
132 } 182 }
133 } 183 }
134}); 184});
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html
index 3936328e..de2969bb 100644
--- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html
+++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.html
@@ -70,7 +70,14 @@
70 "prototype" : "js/panels/Timeline/PropertyTrack.reel", 70 "prototype" : "js/panels/Timeline/PropertyTrack.reel",
71 "properties" : { 71 "properties" : {
72 "element":{"#": "style-track-base"} 72 "element":{"#": "style-track-base"}
73 } 73 },
74 "bindings" : {
75 "trackData" : {
76 "boundObject" : {"@" : "styleTrackRepetition"},
77 "boundObjectPropertyPath" : "objectAtCurrentIteration.propTrackData",
78 "oneway" : false
79 }
80 }
74 }, 81 },
75 "positionTracksRepetition": { 82 "positionTracksRepetition": {
76 "prototype": "montage/ui/repetition.reel", 83 "prototype": "montage/ui/repetition.reel",