]> source.dussan.org Git - jquery-ui.git/commitdiff
Spinner: Some code and test cleanup
authorjzaefferer <joern.zaefferer@gmail.com>
Sun, 24 Oct 2010 13:52:26 +0000 (15:52 +0200)
committerjzaefferer <joern.zaefferer@gmail.com>
Sun, 24 Oct 2010 13:52:26 +0000 (15:52 +0200)
tests/unit/spinner/spinner.html
tests/unit/spinner/spinner_defaults.js
tests/unit/spinner/spinner_options.js
ui/jquery.ui.spinner.js

index df91c926ec3c5a7abfe751a0ce9f3d2f97896754..954e82ea5c2f530b38678ce76f4f7a33f7183ea7 100644 (file)
@@ -9,6 +9,7 @@
        <script type="text/javascript" src="../../../external/jquery.mousewheel-3.0.2.js"></script>\r
        <script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>\r
        <script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>\r
+       <script type="text/javascript" src="../../../ui/jquery.ui.button.js"></script>\r
        <script type="text/javascript" src="../../../ui/jquery.ui.spinner.js"></script>\r
 \r
        <link rel="stylesheet" href="../../../external/qunit.css" type="text/css"/>\r
index 94d3d67ab5a6745ffb939d9523063c9acb713300..7eb3f0a17e3b4cf7c4e0069166789cf583a5f16a 100644 (file)
@@ -3,24 +3,17 @@
  */\r
 \r
 var spinner_defaults = {\r
-       buttons: 'show',\r
-       currency: false,\r
        dir: 'ltr',\r
        disabled: false,\r
-       groupSeparator: '',\r
        incremental: true,\r
        max: null,\r
        min: null,\r
        mouseWheel: true,\r
-       padding: 0,\r
+       numberformat: "n",\r
        page: 5,\r
-       precision: 0,\r
-       radix: 10,\r
-       radixPoint: '.',\r
        spinnerClass: null,\r
        step: null,\r
-       value: 0,\r
-       width: false\r
+       value: 0\r
 };\r
 \r
 commonWidgetTests('spinner', { defaults: spinner_defaults });\r
index b568d3cdd563c3425cff1dafd7f6d575c3ebdbd5..c3bcac82015cc98cd40ff6fc52f658370666824f 100644 (file)
@@ -468,15 +468,4 @@ test("value", function() {
        equals(el.val(), 1000, "value option changed and set as current value");\r
 });\r
 \r
-test("width", function() {\r
-       expect(2);\r
-       \r
-       el = $('#spin').spinner({ width: 1000 });\r
-       equals(el.width(), 1000, "spinner width initialized");\r
-\r
-       el.spinner('option', 'width', 500);\r
-       equals(el.width(), 500, "spinner width changed");\r
-\r
-});\r
-\r
 })(jQuery);\r
index f4227b8f6eec9f1e3eae1404253f334d0d4349e1..02bb41ac0141f2749320df8c03f27da386503d00 100644 (file)
@@ -27,7 +27,6 @@ $.widget('ui.spinner', {
                min: null,\r
                mouseWheel: true,\r
                numberformat: "n",\r
-               padding: 0,\r
                page: 5,\r
                spinnerClass: null,\r
                step: null,\r
@@ -35,7 +34,7 @@ $.widget('ui.spinner', {
        },\r
        \r
        _create: function() {           \r
-               this.value(this._parse(this.element.val() || this.options.value));\r
+               this.value(this.element.val() || this.options.value);\r
                this._draw();\r
                this._mousewheel();\r
                this._aria();\r