r2954 commited - spinner: removed console.log's; using this.options.disabled rather tha...

r2954 commited - spinner: removed console.log's; using this.options.disabled rather tha...


Revision: 2954
Author: pazu2k@gmail.com
Date: Tue Jul 21 09:04:51 2009
Log: spinner: removed console.log's; using this.options.disabled rather
than this.disabled.
http://code.google.com/p/jquery-ui/source/detail?r=2954
Modified:
/branches/dev/spinner/ui/ui.spinner.js
=======================================
--- /branches/dev/spinner/ui/ui.spinner.js    Tue Jul 21 08:31:59 2009
+++ /branches/dev/spinner/ui/ui.spinner.js    Tue Jul 21 09:04:51 2009
@@ -86,11 +86,11 @@
                .attr('aria-valuenow',options.value)
                // add behaviours
                .hover(function() {
-                    if (!options.readOnly && !self.disabled) {
+                    if (!options.readOnly && !options.disabled) {
                        $(this).addClass(hover);
                    }
                    self.hovered = true;
-                    if (typeof options.hide != 'boolean' && !self.focused
&& !self.disabled) {
+                    if (typeof options.hide != 'boolean' && !self.focused
&& !options.disabled) {
                        self._delay(self._show, 100, 'hide', options.hide);
                    }
                }, function() {
@@ -133,7 +133,7 @@
                }
                widget.addClass(active);
                self.focused = true;
-                if (!self.hovered && typeof options.hide != 'boolean'
&& !self.disabled) {
+                if (!self.hovered && typeof options.hide != 'boolean'
&& !options.disabled) {
                    self._delay(self._show, 100, 'hide', options.hide);
                }
            })
@@ -164,7 +164,7 @@
                self._start(event);
                self._mousedown(100, $(this).hasClass('ui-spinner-up') ? 1 : -1,
event);
-                if (!self.disabled) {
+                if (!self.options.disabled) {
                    $(this).addClass(active);
                    if (!options.readOnly) {
                        widget.addClass(active);
@@ -192,7 +192,7 @@
                }
            })
            .hover(function() {
-                if (!self.disabled) {
+                if (!self.options.disabled) {
                    $(this).addClass(hover);
                }
            }, function(event) {
@@ -241,7 +241,7 @@
        }
    },
    _spin: function(step, event) {
-        if (this.disabled) {
+        if (this.options.disabled) {
            return;
        }
        if (!this.counter) {
@@ -414,7 +414,7 @@
            }
            return;
-        }
+        }
    },
    _validChars: function() {
        var radix = parseInt(this.options.radix);
@@ -428,19 +428,16 @@
    },
    _parse: function(val) {
        if (typeof val == 'string') {
-            console.log('before: '+ val);
            if (this.options.groupSeparator) {
                val = val.replace(new
RegExp('\\'+this.options.groupSeparator,'g'), '');
            }
            val = val.replace(new RegExp('[^' + this._validChars()
+ ']', 'gi'), '').split(this.options.radixPoint);
            result = parseInt(val[0], this.options.radix);
-            console.log(val);
            if (val.length > 1) {
                result += parseInt(val[1], this.options.radix) /
Math.pow(this.options.radix, val[1].length) *
                    // must test first character of val[0] for minus sign because -0 is
parsed as 0 in result
                    (val[0][0] == '-' ? -1 : 1);
            }
-            console.log('after: ' + result);
            val = result;
        }
        return isNaN(val) ? null : val;
@@ -497,7 +494,7 @@
                .removeAttr('disabled')
            .parent()
                .removeClass('ui-state-disabled');
-        this.disabled = false;
+        this.options.disabled = false;
    },
    disable: function() {
        this.element
@@ -506,7 +503,7 @@
                .attr('disabled', true)
            .parent()
                .addClass('ui-state-disabled');
-        this.disabled = true;
+        this.options.disabled = true;
    },
    value: function(newVal) {
        if (!arguments.length) {
@@ -537,11 +534,9 @@
    defaults: {
        currency: false,
        dir: 'ltr',
-        format: '%',
        groupSeparator: '',
        hide: false,
        incremental: true,
-        items: null,
        max: null,
        min: null,
        mouseWheel: true,