]> source.dussan.org Git - jquery-ui.git/commitdiff
Slider: added support for canceling start event. Fixes #5472 - slider: event start...
authorRichard D. Worth <rdworth@gmail.com>
Thu, 1 Apr 2010 19:08:20 +0000 (15:08 -0400)
committerRichard D. Worth <rdworth@gmail.com>
Thu, 1 Apr 2010 19:08:20 +0000 (15:08 -0400)
ui/jquery.ui.slider.js

index dd79cb7301416d7044963c072b5d33c560423d98..84d19ccf5e5e2451f7deafb07c6f54f760114f88 100644 (file)
@@ -147,7 +147,10 @@ $.widget("ui.slider", $.ui.mouse, {
                                        if (!self._keySliding) {
                                                self._keySliding = true;
                                                $(this).addClass("ui-state-active");
-                                               self._start(event, index);
+                                               var allowed = self._start(event, index);
+                                               if (allowed === false) {
+                                                       return;
+                                               }
                                        }
                                        break;
                        }
@@ -262,7 +265,10 @@ $.widget("ui.slider", $.ui.mouse, {
                        closestHandle = $(this.handles[++index]);
                }
 
-               this._start(event, index);
+               var allowed = this._start(event, index);
+               if (allowed === false) {
+                       return false;
+               }
                this._mouseSliding = true;
 
                self._handleIndex = index;
@@ -354,7 +360,7 @@ $.widget("ui.slider", $.ui.mouse, {
                        uiHash.value = this.values(index);
                        uiHash.values = this.values();
                }
-               this._trigger("start", event, uiHash);
+               return this._trigger("start", event, uiHash);
        },
 
        _slide: function(event, index, newVal) {