aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.spinner.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/jquery.ui.spinner.js')
-rw-r--r--ui/jquery.ui.spinner.js13
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" ) {