Skip to content
Permalink
Browse files

Spinner: Some code and test cleanup

  • Loading branch information...
jzaefferer committed Oct 24, 2010
1 parent eebf8c3 commit 02d8f914b68f73537dcaca272087b544b366bb2b
@@ -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);
@@ -27,15 +27,14 @@ $.widget('ui.spinner', {
min: null,
mouseWheel: true,
numberformat: "n",
padding: 0,
page: 5,
spinnerClass: null,
step: null,
value: 0
},

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

0 comments on commit 02d8f91

Please sign in to comment.
You can’t perform that action at this time.