diff options
author | Jon Reid | 2012-06-14 14:29:37 -0700 |
---|---|---|
committer | Jon Reid | 2012-06-14 14:29:37 -0700 |
commit | 53bb51a38edc6fe7cc80c43d34027590a22a1d32 (patch) | |
tree | 72cf5f580f32c5f21f573c7812a3a387917ab01e /js/panels/Timeline/Span.reel/Span.js | |
parent | 0d226dd2aa36721feccb9ba3c67bd730f7a01201 (diff) | |
download | ninja-53bb51a38edc6fe7cc80c43d34027590a22a1d32.tar.gz |
Timeline: New easing menu.
Diffstat (limited to 'js/panels/Timeline/Span.reel/Span.js')
-rw-r--r-- | js/panels/Timeline/Span.reel/Span.js | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/js/panels/Timeline/Span.reel/Span.js b/js/panels/Timeline/Span.reel/Span.js index 44316469..7347ef51 100644 --- a/js/panels/Timeline/Span.reel/Span.js +++ b/js/panels/Timeline/Span.reel/Span.js | |||
@@ -152,9 +152,25 @@ var Span = exports.Span = Montage.create(Component, { | |||
152 | //this.areChoicesVisible = true; | 152 | //this.areChoicesVisible = true; |
153 | this.application.ninja.timeline.easingMenu.anchor = this.easing_choice; | 153 | this.application.ninja.timeline.easingMenu.anchor = this.easing_choice; |
154 | this.application.ninja.timeline.easingMenu.currentChoice = event.currentTarget.innerText; | 154 | this.application.ninja.timeline.easingMenu.currentChoice = event.currentTarget.innerText; |
155 | console.log(event); | 155 | |
156 | this.application.ninja.timeline.easingMenu.top = 100; | 156 | function findPos(obj) { |
157 | this.application.ninja.timeline.easingMenu.left = 100; | 157 | var objReturn = {}; |
158 | objReturn.top = 0; | ||
159 | objReturn.left = 0; | ||
160 | |||
161 | if (obj.offsetParent) { | ||
162 | |||
163 | do { | ||
164 | objReturn.left += obj.offsetLeft; | ||
165 | objReturn.top += obj.offsetTop; | ||
166 | |||
167 | } while (obj = obj.offsetParent); | ||
168 | } | ||
169 | return objReturn; | ||
170 | } | ||
171 | var objPos = findPos(event.target); | ||
172 | this.application.ninja.timeline.easingMenu.top = objPos.top +38 - (this.application.ninja.timeline.layout_tracks.scrollTop); | ||
173 | this.application.ninja.timeline.easingMenu.left = objPos.left+18 - (this.application.ninja.timeline.layout_tracks.scrollLeft); | ||
158 | this.application.ninja.timeline.easingMenu.show(); | 174 | this.application.ninja.timeline.easingMenu.show(); |
159 | this.application.ninja.timeline.easingMenu.callingComponent = this; | 175 | this.application.ninja.timeline.easingMenu.callingComponent = this; |
160 | } | 176 | } |
@@ -162,8 +178,6 @@ var Span = exports.Span = Montage.create(Component, { | |||
162 | handleEasingChoicesClick: { | 178 | handleEasingChoicesClick: { |
163 | value: function(event) { | 179 | value: function(event) { |
164 | event.stopPropagation(); | 180 | event.stopPropagation(); |
165 | |||
166 | console.log("span.handleEasingChoicesClick") | ||
167 | 181 | ||
168 | // Remove the pointer to ourselves | 182 | // Remove the pointer to ourselves |
169 | //this.application.ninja.timeline.currentOpenSpanMenu = false; | 183 | //this.application.ninja.timeline.currentOpenSpanMenu = false; |