From 16f95cb8c70608eeede6c9e0834b184ade6c7752 Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Fri, 4 May 2012 02:21:58 -0700 Subject: update data bindings for subproperty tracks Signed-off-by: Jonathan Duran --- .../Timeline/PropertyTrack.reel/PropertyTrack.js | 54 +++++++++++++++++++++- .../Timeline/TimelineTrack.reel/TimelineTrack.html | 9 +++- 2 files changed, 60 insertions(+), 3 deletions(-) (limited to 'js/panels/Timeline') 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, { prepareForDraw:{ value:function(){ this.element.addEventListener("click", this, false); + this.trackID = this.parentComponent.parentComponent.parentComponent.trackID; + this.animatedElement = this.parentComponent.parentComponent.parentComponent.animatedElement; } }, @@ -29,6 +31,10 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, { value:null }, + animatedElement:{ + value:null + }, + propTweenRepetition:{ serializable:true, get:function () { @@ -53,10 +59,56 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, { } }, + _propTrackData:{ + value:false + }, + + propTrackData:{ + get:function () { + return this._propTrackData; + }, + set:function (val) { + this._propTrackData = val; + if (this._propTrackData) { + this.setData(); + } + } + }, + + setData:{ + value:function(){ + if (typeof(this.propTrackData) === "undefined") { + return; + } + + + this.propTweens = this.propTrackData.propTweens; + + this.needsDraw = true; + } + }, + nextKeyframe:{ value:1 }, + _trackID:{ + value:null + }, + + trackID:{ + serializable:true, + get:function () { + return this._trackID; + }, + set:function (value) { + if (value !== this._trackID) { + this._trackID = value; + this.propTrackData.layerID = value; + } + } + }, + handleClick:{ value:function(ev){ var parentTrackID = this.parentComponent.parentComponent.parentComponent.trackID; @@ -126,9 +178,7 @@ var PropertyTrack = exports.PropertyTrack = Montage.create(Component, { addPropAnimationRuleToElement:{ value:function(tweenEvent){ - console.log("SECOND PROP TWEEN ADDING at " + tweenEvent.offsetX); this.insertPropTween(tweenEvent.offsetX); - } } }); 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 @@ "prototype" : "js/panels/Timeline/PropertyTrack.reel", "properties" : { "element":{"#": "style-track-base"} - } + }, + "bindings" : { + "trackData" : { + "boundObject" : {"@" : "styleTrackRepetition"}, + "boundObjectPropertyPath" : "objectAtCurrentIteration.propTrackData", + "oneway" : false + } + } }, "positionTracksRepetition": { "prototype": "montage/ui/repetition.reel", -- cgit v1.2.3