aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/EasingMenu.reel/EasingMenu.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/Timeline/EasingMenu.reel/EasingMenu.js')
-rw-r--r--js/panels/Timeline/EasingMenu.reel/EasingMenu.js17
1 files changed, 13 insertions, 4 deletions
diff --git a/js/panels/Timeline/EasingMenu.reel/EasingMenu.js b/js/panels/Timeline/EasingMenu.reel/EasingMenu.js
index f0547e31..ced3ae6a 100644
--- a/js/panels/Timeline/EasingMenu.reel/EasingMenu.js
+++ b/js/panels/Timeline/EasingMenu.reel/EasingMenu.js
@@ -81,7 +81,7 @@ var EasingMenu = exports.EasingMenu = Montage.create(Component, {
81 81
82 // currentChoice: The data attribute of the current choice 82 // currentChoice: The data attribute of the current choice
83 _currentChoice: { 83 _currentChoice: {
84 value: null 84 value: "none"
85 }, 85 },
86 currentChoice: { 86 currentChoice: {
87 get: function() { 87 get: function() {
@@ -109,8 +109,14 @@ var EasingMenu = exports.EasingMenu = Montage.create(Component, {
109 draw: { 109 draw: {
110 value: function() { 110 value: function() {
111 // Update the selection classes. 111 // Update the selection classes.
112 this.element.querySelector(".easing-selected").classList.remove("easing-selected"); 112 var easingSelected = this.element.querySelector(".easing-selected");
113 this.element.querySelector('[data-ninja-ease="'+this.currentChoice+'"]').classList.add("easing-selected"); 113 if (easingSelected !== null) {
114 easingSelected.classList.remove("easing-selected");
115 }
116 var dataEl = this.element.querySelector('[data-ninja-ease="'+this.currentChoice+'"]');
117 if (dataEl !== null) {
118 dataEl.classList.add("easing-selected");
119 }
114 } 120 }
115 }, 121 },
116 didDraw: { 122 didDraw: {
@@ -147,7 +153,10 @@ var EasingMenu = exports.EasingMenu = Montage.create(Component, {
147 event.stopPropagation(); 153 event.stopPropagation();
148 154
149 // Un-highlight the old choice and highlight the new choice 155 // Un-highlight the old choice and highlight the new choice
150 this.element.querySelector(".easing-selected").classList.remove("easing-selected"); 156 var easingSelected = this.element.querySelector(".easing-selected");
157 if (easingSelected !== null) {
158 easingSelected.classList.remove("easing-selected");
159 }
151 event.target.classList.add("easing-selected"); 160 event.target.classList.add("easing-selected");
152 161
153 // Set the easing in the span that called us 162 // Set the easing in the span that called us