mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Spinner: Some code and test cleanup
This commit is contained in:
parent
eebf8c31ff
commit
02d8f914b6
@ -9,6 +9,7 @@
|
||||
<script type="text/javascript" src="../../../external/jquery.mousewheel-3.0.2.js"></script>
|
||||
<script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
|
||||
<script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
|
||||
<script type="text/javascript" src="../../../ui/jquery.ui.button.js"></script>
|
||||
<script type="text/javascript" src="../../../ui/jquery.ui.spinner.js"></script>
|
||||
|
||||
<link rel="stylesheet" href="../../../external/qunit.css" type="text/css"/>
|
||||
|
@ -3,24 +3,17 @@
|
||||
*/
|
||||
|
||||
var spinner_defaults = {
|
||||
buttons: 'show',
|
||||
currency: false,
|
||||
dir: 'ltr',
|
||||
disabled: false,
|
||||
groupSeparator: '',
|
||||
incremental: true,
|
||||
max: null,
|
||||
min: null,
|
||||
mouseWheel: true,
|
||||
padding: 0,
|
||||
numberformat: "n",
|
||||
page: 5,
|
||||
precision: 0,
|
||||
radix: 10,
|
||||
radixPoint: '.',
|
||||
spinnerClass: null,
|
||||
step: null,
|
||||
value: 0,
|
||||
width: false
|
||||
value: 0
|
||||
};
|
||||
|
||||
commonWidgetTests('spinner', { defaults: spinner_defaults });
|
||||
|
@ -468,15 +468,4 @@ test("value", function() {
|
||||
equals(el.val(), 1000, "value option changed and set as current value");
|
||||
});
|
||||
|
||||
test("width", function() {
|
||||
expect(2);
|
||||
|
||||
el = $('#spin').spinner({ width: 1000 });
|
||||
equals(el.width(), 1000, "spinner width initialized");
|
||||
|
||||
el.spinner('option', 'width', 500);
|
||||
equals(el.width(), 500, "spinner width changed");
|
||||
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
|
3
ui/jquery.ui.spinner.js
vendored
3
ui/jquery.ui.spinner.js
vendored
@ -27,7 +27,6 @@ $.widget('ui.spinner', {
|
||||
min: null,
|
||||
mouseWheel: true,
|
||||
numberformat: "n",
|
||||
padding: 0,
|
||||
page: 5,
|
||||
spinnerClass: null,
|
||||
step: null,
|
||||
@ -35,7 +34,7 @@ $.widget('ui.spinner', {
|
||||
},
|
||||
|
||||
_create: function() {
|
||||
this.value(this._parse(this.element.val() || this.options.value));
|
||||
this.value(this.element.val() || this.options.value);
|
||||
this._draw();
|
||||
this._mousewheel();
|
||||
this._aria();
|
||||
|
Loading…
Reference in New Issue
Block a user