aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.spinner.js
diff options
context:
space:
mode:
authorjzaefferer <joern.zaefferer@gmail.com>2010-10-27 17:45:32 +0200
committerjzaefferer <joern.zaefferer@gmail.com>2010-10-27 17:45:32 +0200
commit78872dca42bad0e58a8e0bd34c415c036d97ebe4 (patch)
tree8d728faf8bb5930eb3b0ae63928bf5f8e7c1e2c5 /ui/jquery.ui.spinner.js
parentd91cd61f79bf048539ac9443ae3d8ffcbe55ef90 (diff)
downloadjquery-ui-78872dca42bad0e58a8e0bd34c415c036d97ebe4.tar.gz
jquery-ui-78872dca42bad0e58a8e0bd34c415c036d97ebe4.zip
Spinner: Improved mousewheel event handling
Diffstat (limited to 'ui/jquery.ui.spinner.js')
-rw-r--r--ui/jquery.ui.spinner.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/ui/jquery.ui.spinner.js b/ui/jquery.ui.spinner.js
index b6cf615da..349dc73c9 100644
--- a/ui/jquery.ui.spinner.js
+++ b/ui/jquery.ui.spinner.js
@@ -183,23 +183,26 @@ $.widget('ui.spinner', {
},
_mousewheel: function() {
+ // need the delta normalization that mousewheel plugin provides
+ if (!$.fn.mousewheel) {
+ return;
+ }
var self = this;
this.element.bind("mousewheel.spinner", function(event, delta) {
if (self.options.disabled) {
return;
}
- if (!self._start(event)) {
+ if (!self.spinning && !self._start(event)) {
return false;
}
self._spin((delta > 0 ? 1 : -1) * self.options.step, event);
clearTimeout(self.timeout);
- // TODO can we implement that without a timeout?
self.timeout = setTimeout(function() {
if (self.spinning) {
self._stop(event);
self._change(event);
}
- }, 13);
+ }, 100);
event.preventDefault();
});
},
@@ -214,7 +217,7 @@ $.widget('ui.spinner', {
},
_start: function(event) {
- if (!this.spinning && this._trigger('start', event, { value: this.options.value}) !== false) {
+ if (!this.spinning && this._trigger('start', event) !== false) {
if (!this.counter) {
this.counter = 1;
}