diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2012-01-11 20:00:04 +0100 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2012-01-11 20:00:04 +0100 |
commit | 021243bc9b8aa81a3461564ce17ca3fc360fb948 (patch) | |
tree | f274814ddb7c6930cf5d1f331bbacc4772feac37 /ui/jquery.ui.spinner.js | |
parent | bd7bd936d1e437ee1154ab6b7b1cdc70b1018363 (diff) | |
parent | 370bc00150f1f77275a861a3c15138b488061871 (diff) | |
download | jquery-ui-021243bc9b8aa81a3461564ce17ca3fc360fb948.tar.gz jquery-ui-021243bc9b8aa81a3461564ce17ca3fc360fb948.zip |
Merge branch 'master' into selectmenu
Diffstat (limited to 'ui/jquery.ui.spinner.js')
-rw-r--r-- | ui/jquery.ui.spinner.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ui/jquery.ui.spinner.js b/ui/jquery.ui.spinner.js index b78b4dbea..c99520b7c 100644 --- a/ui/jquery.ui.spinner.js +++ b/ui/jquery.ui.spinner.js @@ -45,7 +45,14 @@ $.widget( "ui.spinner", { }, _create: function() { + // handle string values that need to be parsed + this._setOption( "max", this.options.max ); + this._setOption( "min", this.options.min ); + this._setOption( "step", this.options.step ); + + // format the value, but don't constrain this._value( this.element.val(), true ); + this._draw(); this._bind( this._events ); this._refresh(); @@ -318,6 +325,12 @@ $.widget( "ui.spinner", { return; } + if ( key === "max" || key === "min" || key === "step" ) { + if ( typeof value === "string" ) { + value = this._parse( value ); + } + } + this._super( key, value ); if ( key === "disabled" ) { |