mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Spinner: Changed casing of option numberformat -> numberFormat.
This commit is contained in:
parent
63b89b7884
commit
af35f0bbc9
@ -27,7 +27,7 @@
|
||||
max: 2500,
|
||||
step: 25,
|
||||
start: 1000,
|
||||
numberformat: "C"
|
||||
numberFormat: "C"
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -18,7 +18,7 @@
|
||||
$(function() {
|
||||
$("#spinner").spinner({
|
||||
step: 0.01,
|
||||
numberformat: "n"
|
||||
numberFormat: "n"
|
||||
});
|
||||
|
||||
$("#culture").change(function() {
|
||||
|
@ -4,7 +4,7 @@ commonWidgetTests( "spinner", {
|
||||
incremental: true,
|
||||
max: null,
|
||||
min: null,
|
||||
numberformat: null,
|
||||
numberFormat: null,
|
||||
page: 10,
|
||||
step: null,
|
||||
value: null,
|
||||
|
@ -5,26 +5,26 @@
|
||||
|
||||
module("spinner: options");
|
||||
|
||||
test("numberformat, number", function() {
|
||||
test("numberFormat, number", function() {
|
||||
var el = $("#spin").spinner({
|
||||
value: "1",
|
||||
numberformat: "n"
|
||||
numberFormat: "n"
|
||||
});
|
||||
equal(el.val(), "1.00");
|
||||
});
|
||||
|
||||
test("numberformat, number, simple", function() {
|
||||
test("numberFormat, number, simple", function() {
|
||||
var el = $("#spin").spinner({
|
||||
value: "1",
|
||||
numberformat: "n0"
|
||||
numberFormat: "n0"
|
||||
});
|
||||
equal(el.val(), "1");
|
||||
});
|
||||
|
||||
test("numberformat, currency", function() {
|
||||
test("numberFormat, currency", function() {
|
||||
var el = $("#spin").spinner({
|
||||
value: "1",
|
||||
numberformat: "C"
|
||||
numberFormat: "C"
|
||||
});
|
||||
equal(el.val(), "$1.00");
|
||||
});
|
||||
@ -111,7 +111,7 @@ test("step, 2", function() {
|
||||
test("step, 0.7", function() {
|
||||
var el = $("#spin").spinner({
|
||||
step: 0.7,
|
||||
numberformat: "n1"
|
||||
numberFormat: "n1"
|
||||
});
|
||||
equals(el.val(), "0.0", "value initialized to");
|
||||
|
||||
|
6
ui/jquery.ui.spinner.js
vendored
6
ui/jquery.ui.spinner.js
vendored
@ -20,7 +20,7 @@ $.widget( "ui.spinner", {
|
||||
incremental: true,
|
||||
max: null,
|
||||
min: null,
|
||||
numberformat: null,
|
||||
numberFormat: null,
|
||||
page: 10,
|
||||
step: null,
|
||||
value: null
|
||||
@ -318,13 +318,13 @@ $.widget( "ui.spinner", {
|
||||
|
||||
_parse: function( val ) {
|
||||
if ( typeof val === "string" ) {
|
||||
val = $.global && this.options.numberformat ? $.global.parseFloat( val ) : +val;
|
||||
val = $.global && this.options.numberFormat ? $.global.parseFloat( val ) : +val;
|
||||
}
|
||||
return isNaN( val ) ? null : val;
|
||||
},
|
||||
|
||||
_format: function( num ) {
|
||||
this.element.val( $.global && this.options.numberformat ? $.global.format( num, this.options.numberformat ) : num );
|
||||
this.element.val( $.global && this.options.numberFormat ? $.global.format( num, this.options.numberFormat ) : num );
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
|
Loading…
Reference in New Issue
Block a user