aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/Keyframe.reel/Keyframe.js
diff options
context:
space:
mode:
authorJonathan Duran2012-02-07 21:28:14 -0800
committerJonathan Duran2012-02-07 21:28:14 -0800
commit8cb53b7ec3b4f34fd77945256ad80bc1ae54b887 (patch)
tree1a626e27a32251d2820b6ee23d03452e479d1122 /js/panels/Timeline/Keyframe.reel/Keyframe.js
parent156b0648c6b046f74303221ce632a49fb28c9a8a (diff)
downloadninja-8cb53b7ec3b4f34fd77945256ad80bc1ae54b887.tar.gz
Add Span color highlight for animated spans and restyle keyframes
Signed-off-by: Jonathan Duran <jduran@motorola.com>
Diffstat (limited to 'js/panels/Timeline/Keyframe.reel/Keyframe.js')
-rw-r--r--js/panels/Timeline/Keyframe.reel/Keyframe.js23
1 files changed, 13 insertions, 10 deletions
diff --git a/js/panels/Timeline/Keyframe.reel/Keyframe.js b/js/panels/Timeline/Keyframe.reel/Keyframe.js
index 4bb73514..b6623dcd 100644
--- a/js/panels/Timeline/Keyframe.reel/Keyframe.js
+++ b/js/panels/Timeline/Keyframe.reel/Keyframe.js
@@ -78,6 +78,10 @@ var Keyframe = exports.Keyframe = Montage.create(Component, {
78 } 78 }
79 }, 79 },
80 80
81 containingSpan:{
82 value: null
83 },
84
81 prepareForDraw:{ 85 prepareForDraw:{
82 value:function(){ 86 value:function(){
83 this.tweenkeyframe.addEventListener("click", this, false); 87 this.tweenkeyframe.addEventListener("click", this, false);
@@ -91,7 +95,7 @@ var Keyframe = exports.Keyframe = Montage.create(Component, {
91 95
92 draw:{ 96 draw:{
93 value:function(){ 97 value:function(){
94 this.tweenkeyframe.style.left = (this.position - 2) + "px"; 98 this.tweenkeyframe.style.left = (this.position - 3) + "px";
95 } 99 }
96 }, 100 },
97 101
@@ -101,16 +105,15 @@ var Keyframe = exports.Keyframe = Montage.create(Component, {
101 if(event.detail.source && event.detail.source !== "keyframe") { 105 if(event.detail.source && event.detail.source !== "keyframe") {
102 106
103 var items = this.application.ninja.selectedElements; 107 var items = this.application.ninja.selectedElements;
104 108 this.containingSpan.highlightSpan();
105 // update this keyframe's animated properties from the item[0] element props 109 if(items[0]._element.offsetTop != this.animatedProperties["top"] && items[0]._element.offsetLeft != this.animatedProperties["left"]){
106 this.animatedProperties["top"] = items[0]._element.offsetTop; 110 // update this keyframe's animated properties from the item[0] element props
107 this.animatedProperties["left"] = items[0]._element.offsetLeft; 111 this.animatedProperties["top"] = items[0]._element.offsetTop;
108 this.containingTrack.keyFramePropertyData[this.id] = this.animatedProperties; 112 this.animatedProperties["left"] = items[0]._element.offsetLeft;
109 113 this.containingTrack.keyFramePropertyData[this.id] = this.animatedProperties;
110 this.containingTrack.updateKeyframeRule(); 114 this.containingTrack.updateKeyframeRule();
115 }
111 } 116 }
112
113
114 } 117 }
115 }, 118 },
116 119