diff options
author | jzaefferer <joern.zaefferer@gmail.com> | 2010-12-01 23:28:05 +0100 |
---|---|---|
committer | jzaefferer <joern.zaefferer@gmail.com> | 2010-12-01 23:28:05 +0100 |
commit | 0d0ec376e35f1eaaba8199c2abc83a17d5c655a8 (patch) | |
tree | 3a01800e8260fdad1209c4e14cf7b42ce716edb6 /ui | |
parent | 7a85cbe5a17d8c58e3071ba50a78c2c2a66a8bb1 (diff) | |
download | jquery-ui-0d0ec376e35f1eaaba8199c2abc83a17d5c655a8.tar.gz jquery-ui-0d0ec376e35f1eaaba8199c2abc83a17d5c655a8.zip |
Spinner: Introduce page option to configure page size. Use that for timespinner demo to spin minutes on cursor up/down, hours on page up/down.
Diffstat (limited to 'ui')
-rw-r--r-- | ui/jquery.ui.spinner.js | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/ui/jquery.ui.spinner.js b/ui/jquery.ui.spinner.js index 7f32adbd8..39a498359 100644 --- a/ui/jquery.ui.spinner.js +++ b/ui/jquery.ui.spinner.js @@ -13,15 +13,13 @@ */ (function($) { -// shortcut constants -var pageModifier = 10; - $.widget('ui.spinner', { options: { incremental: true, max: null, min: null, numberformat: null, + page: 10, step: null, value: null }, @@ -161,10 +159,10 @@ $.widget('ui.spinner', { this._repeat(null, -1, event); return false; case KEYS.PAGE_UP: - this._repeat(null, pageModifier, event); + this._repeat(null, this.options.page, event); return false; case KEYS.PAGE_DOWN: - this._repeat(null, -pageModifier, event); + this._repeat(null, -this.options.page, event); return false; case KEYS.ENTER: @@ -340,11 +338,11 @@ $.widget('ui.spinner', { }, pageUp: function(pages) { - this.stepUp((pages || 1) * pageModifier); + this.stepUp((pages || 1) * this.options.page); }, pageDown: function(pages) { - this.stepDown((pages || 1) * pageModifier); + this.stepDown((pages || 1) * this.options.page); }, value: function(newVal) { |