aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/Keyframe.reel/Keyframe.js
diff options
context:
space:
mode:
authorJonathan Duran2012-02-09 11:17:47 -0800
committerJonathan Duran2012-02-09 11:17:47 -0800
commita822fec0e8e044b647306ed50619cb9a818269e4 (patch)
tree56ff7fb54b2cf80c594aa8a34989b6130fca8e4f /js/panels/Timeline/Keyframe.reel/Keyframe.js
parentf6ad57e346a7fac5efe64473642c80fff763299b (diff)
downloadninja-a822fec0e8e044b647306ed50619cb9a818269e4.tar.gz
Fixes for animation element assignment
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.js16
1 files changed, 7 insertions, 9 deletions
diff --git a/js/panels/Timeline/Keyframe.reel/Keyframe.js b/js/panels/Timeline/Keyframe.reel/Keyframe.js
index c46ae8c9..c82a9086 100644
--- a/js/panels/Timeline/Keyframe.reel/Keyframe.js
+++ b/js/panels/Timeline/Keyframe.reel/Keyframe.js
@@ -86,8 +86,6 @@ var Keyframe = exports.Keyframe = Montage.create(Component, {
86 value:function(){ 86 value:function(){
87 this.tweenkeyframe.addEventListener("click", this, false); 87 this.tweenkeyframe.addEventListener("click", this, false);
88 this.animatedProperties = new Array(); 88 this.animatedProperties = new Array();
89
90 // should element mediator be used here?
91 this.animatedProperties["top"] = this.containingTrack.animatedElement.offsetTop; 89 this.animatedProperties["top"] = this.containingTrack.animatedElement.offsetTop;
92 this.animatedProperties["left"] = this.containingTrack.animatedElement.offsetLeft; 90 this.animatedProperties["left"] = this.containingTrack.animatedElement.offsetLeft;
93 } 91 }
@@ -101,15 +99,16 @@ var Keyframe = exports.Keyframe = Montage.create(Component, {
101 99
102 handleElementChange:{ 100 handleElementChange:{
103 value:function (event) { 101 value:function (event) {
102 if(this.application.ninja.selectedElements[0]._element != this.containingTrack.animatedElement){
103 alert("Wrong element selected for this keyframe track");
104 return;
105 }
104 106
105 if(event.detail.source && event.detail.source !== "keyframe") { 107 if(event.detail.source && event.detail.source !== "keyframe") {
106
107 var items = this.application.ninja.selectedElements;
108 this.containingSpan.highlightSpan(); 108 this.containingSpan.highlightSpan();
109 if(items[0]._element.offsetTop != this.animatedProperties["top"] && items[0]._element.offsetLeft != this.animatedProperties["left"]){ 109 if(this.containingTrack.animatedElement.offsetTop != this.animatedProperties["top"] && this.containingTrack.animatedElement.offsetLeft != this.animatedProperties["left"]){
110 // update this keyframe's animated properties from the item[0] element props 110 this.animatedProperties["top"] = this.containingTrack.animatedElement.offsetTop;
111 this.animatedProperties["top"] = items[0]._element.offsetTop; 111 this.animatedProperties["left"] = this.containingTrack.animatedElement.offsetLeft;
112 this.animatedProperties["left"] = items[0]._element.offsetLeft;
113 this.containingTrack.keyFramePropertyData[this.id] = this.animatedProperties; 112 this.containingTrack.keyFramePropertyData[this.id] = this.animatedProperties;
114 this.containingTrack.updateKeyframeRule(); 113 this.containingTrack.updateKeyframeRule();
115 } 114 }
@@ -120,7 +119,6 @@ var Keyframe = exports.Keyframe = Montage.create(Component, {
120 deselect:{ 119 deselect:{
121 value:function(){ 120 value:function(){
122 this.tweenkeyframe.classList.remove("keyframeSelected"); 121 this.tweenkeyframe.classList.remove("keyframeSelected");
123
124 this.eventManager.removeEventListener("elementChange", this, false); 122 this.eventManager.removeEventListener("elementChange", this, false);
125 } 123 }
126 }, 124 },