diff options
Diffstat (limited to 'js/components')
-rwxr-xr-x | js/components/gradientpicker.reel/gradientpicker.js | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/js/components/gradientpicker.reel/gradientpicker.js b/js/components/gradientpicker.reel/gradientpicker.js index da4e8c0f..b10f6624 100755 --- a/js/components/gradientpicker.reel/gradientpicker.js +++ b/js/components/gradientpicker.reel/gradientpicker.js | |||
@@ -213,21 +213,13 @@ exports.GradientPicker = Montage.create(Component, { | |||
213 | removeStop: { | 213 | removeStop: { |
214 | enumerable: false, | 214 | enumerable: false, |
215 | value: function(stop) { | 215 | value: function(stop) { |
216 | //Removing stops | ||
217 | this.element._components.stopsContainer.removeChild(stop); | ||
218 | //Stopping events related to this current stop | ||
219 | this.removeStopMoving(); | ||
220 | //Resetting stops if less than 2 | ||
221 | var i, buttons = this.element._components.stopsContainer.getElementsByTagName('button'); | 216 | var i, buttons = this.element._components.stopsContainer.getElementsByTagName('button'); |
222 | if (buttons.length < 2) { | 217 | // |
223 | //Removing remaining stops prior to resetting | 218 | if (buttons.length > 2) { |
224 | for (i=0; buttons[i]; i++) { | 219 | //Removing stops |
225 | this.element._components.stopsContainer.removeChild(buttons[i].stop); | 220 | this.element._components.stopsContainer.removeChild(stop); |
226 | } | 221 | //Stopping events related to this current stop |
227 | //Nulling then adding defaults | 222 | this.removeStopMoving(); |
228 | this.value = null; | ||
229 | this.addDefaultStops(); | ||
230 | this._dispatchEvent('change', false); | ||
231 | } | 223 | } |
232 | } | 224 | } |
233 | }, | 225 | }, |
@@ -327,7 +319,7 @@ exports.GradientPicker = Montage.create(Component, { | |||
327 | // | 319 | // |
328 | this.application.ninja.colorController.colorPopupManager.hideColorChipPopup(); | 320 | this.application.ninja.colorController.colorPopupManager.hideColorChipPopup(); |
329 | // | 321 | // |
330 | if ((e._event.y+this.hack.y) > this.element._trackY+50 || (e._event.y+this.hack.y) < this.element._trackY) { | 322 | if ((e._event.y+this.hack.y) > this.element._trackY+70 || (e._event.y+this.hack.y) < this.element._trackY) { |
331 | this.removeStop(this.currentStop); | 323 | this.removeStop(this.currentStop); |
332 | } | 324 | } |
333 | // | 325 | // |