aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2011-08-07 08:20:14 -0400
committerScott González <scott.gonzalez@gmail.com>2011-08-07 08:20:14 -0400
commit051b9e07d9f15a7ee81b9ada1648615cbb85aad9 (patch)
tree5b1362f7216bd2a595af210d78142f08b20c740c
parent8799ba08225d00113df2ed9d5ff4cf9f69b1dd22 (diff)
downloadjquery-ui-051b9e07d9f15a7ee81b9ada1648615cbb85aad9.tar.gz
jquery-ui-051b9e07d9f15a7ee81b9ada1648615cbb85aad9.zip
Spinner: Use _getCreateOptions() for value.
-rw-r--r--tests/unit/spinner/spinner_defaults.js2
-rw-r--r--ui/jquery.ui.spinner.js8
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/unit/spinner/spinner_defaults.js b/tests/unit/spinner/spinner_defaults.js
index 3a6287618..18949ff90 100644
--- a/tests/unit/spinner/spinner_defaults.js
+++ b/tests/unit/spinner/spinner_defaults.js
@@ -7,7 +7,7 @@ commonWidgetTests( "spinner", {
numberFormat: null,
page: 10,
step: 1,
- value: null,
+ value: 0,
// callbacks
change: null,
diff --git a/ui/jquery.ui.spinner.js b/ui/jquery.ui.spinner.js
index a207a8aed..138d32f0a 100644
--- a/ui/jquery.ui.spinner.js
+++ b/ui/jquery.ui.spinner.js
@@ -24,7 +24,7 @@ $.widget( "ui.spinner", {
numberFormat: null,
page: 10,
step: 1,
- value: null,
+ value: 0,
change: null,
spin: null,
@@ -33,7 +33,7 @@ $.widget( "ui.spinner", {
},
_create: function() {
- this.value( this.options.value !== null ? this.options.value : this.element.val() || 0 );
+ this.value( this.options.value );
this._draw();
this._mousewheel();
this._aria();
@@ -43,9 +43,9 @@ $.widget( "ui.spinner", {
var options = {},
element = this.element;
- $.each( [ "min", "max", "step" ], function( i, option ) {
+ $.each( [ "min", "max", "step", "value" ], function( i, option ) {
var value = element.attr( option );
- if ( value !== undefined ) {
+ if ( value !== undefined && value.length ) {
options[ option ] = value;
}
});