diff options
author | Ca-Phun Ung <pazu2k@gmail.com> | 2008-09-23 07:58:29 +0000 |
---|---|---|
committer | Ca-Phun Ung <pazu2k@gmail.com> | 2008-09-23 07:58:29 +0000 |
commit | b5ce43ac6afa4b78b33164a10da4c6c12e83473a (patch) | |
tree | 65fd175d0d7ca1d84ce11cb18852651449e483a6 /ui/ui.spinner.js | |
parent | 6d39f52942a6c75458c9f1eb828ae1d567e0f742 (diff) | |
download | jquery-ui-b5ce43ac6afa4b78b33164a10da4c6c12e83473a.tar.gz jquery-ui-b5ce43ac6afa4b78b33164a10da4c6c12e83473a.zip |
Spinner: Add change event to dblclick and created a new visual test for all callbacks. timer is now set to 0 after being cleared.
Diffstat (limited to 'ui/ui.spinner.js')
-rw-r--r-- | ui/ui.spinner.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ui/ui.spinner.js b/ui/ui.spinner.js index b9fa7a1b3..cbce210e8 100644 --- a/ui/ui.spinner.js +++ b/ui/ui.spinner.js @@ -61,12 +61,15 @@ $.widget('ui.spinner', { }) .bind('mouseout', function(e) { $(this).removeClass('ui-spinner-pressed'); - self._mouseup(e); + if (self.timer) { + self._mouseup(e); + } }) // mousedown/mouseup capture first click, now handle second click .bind('dblclick', function(e) { $(this).removeClass('ui-spinner-pressed'); self._up(e); + self._mouseup(e); }) .bind('keydown.spinner', function(e) { var KEYS = $.keyCode; @@ -106,12 +109,15 @@ $.widget('ui.spinner', { }) .bind('mouseout', function(e) { $(this).removeClass('ui-spinner-pressed'); - self._mouseup(e); + if (self.timer) { + self._mouseup(e); + } }) // mousedown/mouseup capture first click, now handle second click .bind('dblclick', function(e) { $(this).removeClass('ui-spinner-pressed'); self._down(e); + self._mouseup(e); }) .bind('keydown.spinner', function(e) { var KEYS = $.keyCode; @@ -215,6 +221,7 @@ $.widget('ui.spinner', { i = i || 100; if (this.timer) { window.clearInterval(this.timer); + this.timer = 0; } this.timer = window.setInterval(function() { self[d](e); @@ -227,6 +234,7 @@ $.widget('ui.spinner', { this.counter = 0; if (this.timer) { window.clearInterval(this.timer); + this.timer = 0; } this.element[0].focus(); this._propagate('change', e); |