Spinner: Some code and test cleanup

This commit is contained in:
jzaefferer 2010-10-24 15:52:26 +02:00
parent eebf8c31ff
commit 02d8f914b6
4 changed files with 4 additions and 22 deletions

View File

@ -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"/>

View File

@ -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 });

View File

@ -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);

View File

@ -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();