]> source.dussan.org Git - jquery-ui.git/commitdiff
slider: fixed regression caused by a recent change in the mouse core - since the...
authorPaul Bakaus <paul.bakaus@googlemail.com>
Mon, 24 Nov 2008 17:02:26 +0000 (17:02 +0000)
committerPaul Bakaus <paul.bakaus@googlemail.com>
Mon, 24 Nov 2008 17:02:26 +0000 (17:02 +0000)
ui/ui.slider.js

index b678d0af49398bef355aca58eb1d4ffab124034f..ed0644a3024e7b830ff940625990ff8259397eda 100644 (file)
@@ -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