aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorCa-Phun Ung <pazu2k@gmail.com>2008-09-26 07:21:56 +0000
committerCa-Phun Ung <pazu2k@gmail.com>2008-09-26 07:21:56 +0000
commit24afc68d5b4e2cca792980d41cef6f0a1e0fcdda (patch)
treea75b62da1d19a55d790f86772766273652a7ba03 /ui
parentb920e5893a082d0445251c3832e1a40be73e7abf (diff)
downloadjquery-ui-24afc68d5b4e2cca792980d41cef6f0a1e0fcdda.tar.gz
jquery-ui-24afc68d5b4e2cca792980d41cef6f0a1e0fcdda.zip
Spinner: added a timer to mousewheel interaction which fires a change event when the mousewheel stops spinning.
Added a few missing options to test case.
Diffstat (limited to 'ui')
-rw-r--r--ui/ui.spinner.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/ui/ui.spinner.js b/ui/ui.spinner.js
index cbce210e8..8d81716d1 100644
--- a/ui/ui.spinner.js
+++ b/ui/ui.spinner.js
@@ -263,8 +263,14 @@ $.widget('ui.spinner', {
(/[0-9\-\.]/).test(String.fromCharCode(e.keyCode))) ? true : false;
},
_mousewheel: function(e, delta) {
+ var self = this;
delta = ($.browser.opera ? -delta / Math.abs(delta) : delta);
- (delta > 0 ? this._up(e) : this._down(e));
+ (delta > 0 ? self._up(e) : self._down(e));
+ if (self.timeout) {
+ window.clearTimeout(self.timeout);
+ self.timeout = 0;
+ }
+ self.timeout = window.setTimeout(function(){self._propagate('change', e)}, 500);
e.preventDefault();
},
_getValue: function() {