aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/EasingMenu.reel
diff options
context:
space:
mode:
authorJon Reid2012-06-14 14:29:37 -0700
committerJon Reid2012-06-14 14:29:37 -0700
commit53bb51a38edc6fe7cc80c43d34027590a22a1d32 (patch)
tree72cf5f580f32c5f21f573c7812a3a387917ab01e /js/panels/Timeline/EasingMenu.reel
parent0d226dd2aa36721feccb9ba3c67bd730f7a01201 (diff)
downloadninja-53bb51a38edc6fe7cc80c43d34027590a22a1d32.tar.gz
Timeline: New easing menu.
Diffstat (limited to 'js/panels/Timeline/EasingMenu.reel')
-rw-r--r--js/panels/Timeline/EasingMenu.reel/EasingMenu.js22
1 files changed, 16 insertions, 6 deletions
diff --git a/js/panels/Timeline/EasingMenu.reel/EasingMenu.js b/js/panels/Timeline/EasingMenu.reel/EasingMenu.js
index 006efd69..f0547e31 100644
--- a/js/panels/Timeline/EasingMenu.reel/EasingMenu.js
+++ b/js/panels/Timeline/EasingMenu.reel/EasingMenu.js
@@ -92,12 +92,17 @@ var EasingMenu = exports.EasingMenu = Montage.create(Component, {
92 } 92 }
93 }, 93 },
94 94
95 _isShown: {
96 value: false
97 },
98
95 /* End: Models */ 99 /* End: Models */
96 100
97 /* Begin: Draw Cycle */ 101 /* Begin: Draw Cycle */
98 willDraw: { 102 willDraw: {
99 value: function() { 103 value: function() {
100 this.element.addEventListener("click", this.handleEasingChoicesClick.bind(this), false); 104 this.element.addEventListener("click", this.handleEasingChoicesClick.bind(this), false);
105 document.addEventListener("scroll", this.handleDocumentScroll.bind(this), false);
101 } 106 }
102 }, 107 },
103 108
@@ -131,11 +136,8 @@ var EasingMenu = exports.EasingMenu = Montage.create(Component, {
131 position.left = this.left; 136 position.left = this.left;
132 this.popup.position = position; 137 this.popup.position = position;
133 this.popup.show(); 138 this.popup.show();
139 this._isShow = true;
134 140
135
136
137
138
139 // Redraw the content (needed to reflect probable changes in selection from the last time we showed it) 141 // Redraw the content (needed to reflect probable changes in selection from the last time we showed it)
140 this.popup.content.needsDraw = true; 142 this.popup.content.needsDraw = true;
141 } 143 }
@@ -152,9 +154,17 @@ var EasingMenu = exports.EasingMenu = Montage.create(Component, {
152 this.callingComponent.easing = event.target.dataset.ninjaEase; 154 this.callingComponent.easing = event.target.dataset.ninjaEase;
153 155
154 // Hide the menu. 156 // Hide the menu.
155 this.popup.hide(); 157 this.popup.hide();
158 this._isShow = false;
156 } 159 }
157 } 160 },
161 handleDocumentScroll: {
162 value: function(event) {
163 if (this._isShow = true) {
164 this.popup.hide();
165 }
166 }
167 }
158 168
159 /* End: Controllers */ 169 /* End: Controllers */
160 170