slider: added ui.values in the slide callback for a range

This commit is contained in:
Richard Worth
2008-12-31 04:48:12 +00:00
parent 419da55302
commit 1907c374cf

View File

@@ -262,10 +262,13 @@ $.widget("ui.slider", $.extend({}, $.ui.mouse, {
var handle = this.handles.filter(".ui-state-active");
var index = handle.data("index.ui-slider-handle");
if (newVal != this.values(index)) {
var newValues = this.values();
newValues[index] = newVal;
// A slide can be canceled by returning false from the slide callback
var allowed = this._trigger("slide", event, {
handle: handle,
value: newVal
value: newVal,
values: newValues
});
if (allowed !== false)
this.values(index, newVal);