aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard D. Worth <rdworth@gmail.com>2010-04-01 15:08:20 -0400
committerRichard D. Worth <rdworth@gmail.com>2010-04-01 15:08:20 -0400
commit354682e3ebba79e5b0ad014ea10c43f0a57a25e2 (patch)
treeaa16efd95115753ac395cfa1d86f55873c752877
parent5ffd3ab36a6c7d6c0aaad7d84c20b8d78c149a1f (diff)
downloadjquery-ui-354682e3ebba79e5b0ad014ea10c43f0a57a25e2.tar.gz
jquery-ui-354682e3ebba79e5b0ad014ea10c43f0a57a25e2.zip
Slider: added support for canceling start event. Fixes #5472 - slider: event start not cancelable
-rw-r--r--ui/jquery.ui.slider.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/ui/jquery.ui.slider.js b/ui/jquery.ui.slider.js
index dd79cb730..84d19ccf5 100644
--- a/ui/jquery.ui.slider.js
+++ b/ui/jquery.ui.slider.js
@@ -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) {