]> source.dussan.org Git - jquery-ui.git/commitdiff
Spinner: fixed incremental:false issue on mousedown (thanks cloudream)
authorCa-Phun Ung <pazu2k@gmail.com>
Tue, 7 Oct 2008 10:33:32 +0000 (10:33 +0000)
committerCa-Phun Ung <pazu2k@gmail.com>
Tue, 7 Oct 2008 10:33:32 +0000 (10:33 +0000)
ui/ui.spinner.js

index 29eab908ae7eba63a954bf8f2729c70bff576620..1b055221bb2d95e7e94dedf126176fc0389e0d9a 100644 (file)
@@ -209,7 +209,7 @@ $.widget('ui.spinner', {
                if (isNaN(this._getValue())) {
                        this._setValue(this.options.start);
                }
-               this._setValue(this._getValue() + (d == 'up' ? 1:-1) * (this.options.incremental && this.counter > 100 ? (this.counter > 200 ? 100 : 10) : 1) * this.options.stepping);
+               this._setValue(this._getValue() + (d == 'up' ? 1:-1) *(this.options.incremental && this.counter > 100 ? (this.counter > 200 ? 100 : 10) : 1) * this.options.stepping);
                this._animate(d);
                this._constrain();
                if (this.counter) {
@@ -234,7 +234,7 @@ $.widget('ui.spinner', {
                }
                this.timer = window.setInterval(function() {
                        self[d](e);
-                       if (self.counter > 20) {
+                       if (self.options.incremental && self.counter > 20) {
                                self._mousedown(20, d, e);
                        }
                }, i);