aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.slider.js
diff options
context:
space:
mode:
authorRichard Worth <rdworth@gmail.com>2010-03-17 17:39:29 +0000
committerRichard Worth <rdworth@gmail.com>2010-03-17 17:39:29 +0000
commit0604e110524c77a4430666c9719942772b8caa86 (patch)
treeec7e19cb566f7e6b8dc3538167d5ae6bafbaeb45 /ui/jquery.ui.slider.js
parente84a318e4670bed0d8690b0a7625df31d39aaf92 (diff)
downloadjquery-ui-0604e110524c77a4430666c9719942772b8caa86.tar.gz
jquery-ui-0604e110524c77a4430666c9719942772b8caa86.zip
Slider: fixed change event to be triggered by keyup and value and values option setters. Fixes #5367 - slider change event not triggered by keypress
Diffstat (limited to 'ui/jquery.ui.slider.js')
-rw-r--r--ui/jquery.ui.slider.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/ui/jquery.ui.slider.js b/ui/jquery.ui.slider.js
index be90cdb81..c392facd7 100644
--- a/ui/jquery.ui.slider.js
+++ b/ui/jquery.ui.slider.js
@@ -193,9 +193,9 @@ $.widget("ui.slider", $.ui.mouse, {
var index = $(this).data("index.ui-slider-handle");
if (self._keySliding) {
+ self._keySliding = false;
self._stop(event, index);
self._change(event, index);
- self._keySliding = false;
$(this).removeClass("ui-state-active");
}
@@ -479,6 +479,12 @@ $.widget("ui.slider", $.ui.mouse, {
},
_setOption: function(key, value) {
+
+ var i,
+ valsLength = 0;
+ if ( jQuery.isArray(this.options.values) ) {
+ valsLength = this.options.values.length;
+ };
$.Widget.prototype._setOption.apply(this, arguments);
@@ -505,11 +511,15 @@ $.widget("ui.slider", $.ui.mouse, {
case 'value':
this._animateOff = true;
this._refreshValue();
+ this._change(null, 0);
this._animateOff = false;
break;
case 'values':
this._animateOff = true;
this._refreshValue();
+ for (i = 0; i < valsLength; i++) {
+ this._change(null, i);
+ }
this._animateOff = false;
break;
}