diff options
author | Paul Bakaus <paul.bakaus@googlemail.com> | 2008-11-24 17:02:26 +0000 |
---|---|---|
committer | Paul Bakaus <paul.bakaus@googlemail.com> | 2008-11-24 17:02:26 +0000 |
commit | 2b92a02170babdf2d970ecabd2a326a0a7d64f5b (patch) | |
tree | 478eb54c34bce54186ba0f6c7137862c085b649a /ui | |
parent | 0ef9a8ac3dd1d3f1e98012c9744ae98770da4272 (diff) | |
download | jquery-ui-2b92a02170babdf2d970ecabd2a326a0a7d64f5b.tar.gz jquery-ui-2b92a02170babdf2d970ecabd2a326a0a7d64f5b.zip |
slider: fixed regression caused by a recent change in the mouse core - since the mouse core doesn't stop mousedown propagation by default now, the mousedown event was triggered twice - once by the bound handle, and once by the actual element.
Diffstat (limited to 'ui')
-rw-r--r-- | ui/ui.slider.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/ui/ui.slider.js b/ui/ui.slider.js index b678d0af4..ed0644a30 100644 --- a/ui/ui.slider.js +++ b/ui/ui.slider.js @@ -72,9 +72,18 @@ $.widget("ui.slider", { // Bind the click to the slider itself this.element.bind('mousedown.slider', function(event) { + + if($(event.target).is('.ui-slider-handle')) return; + + //Go to the actual clicked posiion, apply a click self._click.apply(self, [event]); - self.currentHandle.data("mouse").trigger(event); - self.firstValue = self.firstValue + 1; //This is for always triggering the change event + + //initiate a handle drag, so we can click+drag somewhere + self.currentHandle.data("mouse").trigger(event); + + //This is for always triggering the change event + self.firstValue = self.firstValue + 1; + }); // Move the first handle to the startValue |