r3123 committed - spinner: fixed bugs in set/get option value

r3123 committed - spinner: fixed bugs in set/get option value


Revision: 3123
Author: pazu2k@gmail.com
Date: Mon Aug 24 04:01:55 2009
Log: spinner: fixed bugs in set/get option value
http://code.google.com/p/jquery-ui/source/detail?r=3123
Modified:
/branches/dev/spinner/ui/ui.spinner.js
=======================================
--- /branches/dev/spinner/ui/ui.spinner.js    Wed Aug 19 07:09:52 2009
+++ /branches/dev/spinner/ui/ui.spinner.js    Mon Aug 24 04:01:55 2009
@@ -327,6 +327,7 @@
        }
        this._format(newVal);
+        this._setData('value', newVal);
        this.uiSpinner && this.uiSpinner.attr('aria-valuenow', this.value());
    },
    _setData: function(key, value) {
@@ -350,6 +351,11 @@
            return;
        }
+
+        if (key === 'value') {
+            this._format(value);
+            return;
+        }
    },
    _validChars: function() {
        var radix = parseInt(this.options.radix);
@@ -438,9 +444,9 @@
            .removeAttr('autocomplete')
            .removeData('spinner')
            .unbind(namespace);
-
+
        if (this.uiSpinner) {
-            this.uiSpinner.replaceWith(this.element);
+            this.uiSpinner.replaceWith(this.element);
        }
    },
    enable: function() {