Skip to content

Commit

Permalink
Slider: added support for canceling start event. Fixes #5472 - slider…
Browse files Browse the repository at this point in the history
…: event start not cancelable
  • Loading branch information
rdworth committed Apr 1, 2010
1 parent 5ffd3ab commit 354682e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions ui/jquery.ui.slider.js
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 354682e

Please sign in to comment.