diff options
author | jzaefferer <joern.zaefferer@gmail.com> | 2010-10-24 15:52:26 +0200 |
---|---|---|
committer | jzaefferer <joern.zaefferer@gmail.com> | 2010-10-24 15:52:26 +0200 |
commit | 02d8f914b68f73537dcaca272087b544b366bb2b (patch) | |
tree | 6b91fe0fb5a9c75664cbb0e52daba1b12f33e778 | |
parent | eebf8c31fff4653cfcbb273f7da5fa7177217dca (diff) | |
download | jquery-ui-02d8f914b68f73537dcaca272087b544b366bb2b.tar.gz jquery-ui-02d8f914b68f73537dcaca272087b544b366bb2b.zip |
Spinner: Some code and test cleanup
-rw-r--r-- | tests/unit/spinner/spinner.html | 1 | ||||
-rw-r--r-- | tests/unit/spinner/spinner_defaults.js | 11 | ||||
-rw-r--r-- | tests/unit/spinner/spinner_options.js | 11 | ||||
-rw-r--r-- | ui/jquery.ui.spinner.js | 3 |
4 files changed, 4 insertions, 22 deletions
diff --git a/tests/unit/spinner/spinner.html b/tests/unit/spinner/spinner.html index df91c926e..954e82ea5 100644 --- a/tests/unit/spinner/spinner.html +++ b/tests/unit/spinner/spinner.html @@ -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"/>
diff --git a/tests/unit/spinner/spinner_defaults.js b/tests/unit/spinner/spinner_defaults.js index 94d3d67ab..7eb3f0a17 100644 --- a/tests/unit/spinner/spinner_defaults.js +++ b/tests/unit/spinner/spinner_defaults.js @@ -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 });
diff --git a/tests/unit/spinner/spinner_options.js b/tests/unit/spinner/spinner_options.js index b568d3cdd..c3bcac820 100644 --- a/tests/unit/spinner/spinner_options.js +++ b/tests/unit/spinner/spinner_options.js @@ -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);
diff --git a/ui/jquery.ui.spinner.js b/ui/jquery.ui.spinner.js index f4227b8f6..02bb41ac0 100644 --- a/ui/jquery.ui.spinner.js +++ b/ui/jquery.ui.spinner.js @@ -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();
|