From 8fe10dc56081aff37ee405832b808e4a80579618 Mon Sep 17 00:00:00 2001 From: jzaefferer Date: Mon, 7 Feb 2011 18:45:10 +0100 Subject: Fix spinner demos to latest jquery-global API. Also cleanup. --- demos/spinner/currency.html | 4 ++-- demos/spinner/decimal.html | 4 ++-- demos/spinner/default.html | 2 +- demos/spinner/index.html | 2 +- demos/spinner/latlong.html | 2 +- demos/spinner/overflow.html | 2 +- demos/spinner/time.html | 9 ++++----- 7 files changed, 12 insertions(+), 13 deletions(-) diff --git a/demos/spinner/currency.html b/demos/spinner/currency.html index 1c2f01a72..44fed4c42 100644 --- a/demos/spinner/currency.html +++ b/demos/spinner/currency.html @@ -1,4 +1,4 @@ - + @@ -18,7 +18,7 @@ $(function() { $("#currency").change(function() { var current = $("#spinner").spinner("value"); - Globalization.preferCulture($(this).val()); + $.global.preferCulture($(this).val()); $("#spinner").spinner("value", current); }) diff --git a/demos/spinner/decimal.html b/demos/spinner/decimal.html index f396c18d2..5b4af2823 100644 --- a/demos/spinner/decimal.html +++ b/demos/spinner/decimal.html @@ -1,4 +1,4 @@ - + @@ -23,7 +23,7 @@ $("#culture").change(function() { var current = $("#spinner").spinner("value"); - Globalization.preferCulture($(this).val()); + $.global.preferCulture($(this).val()); $("#spinner").spinner("value", current); }) }); diff --git a/demos/spinner/default.html b/demos/spinner/default.html index d33f3e241..14e0cf9f9 100644 --- a/demos/spinner/default.html +++ b/demos/spinner/default.html @@ -1,4 +1,4 @@ - + diff --git a/demos/spinner/index.html b/demos/spinner/index.html index a49fa1368..c1b9d9288 100644 --- a/demos/spinner/index.html +++ b/demos/spinner/index.html @@ -1,4 +1,4 @@ - + jQuery UI Spinner Demos diff --git a/demos/spinner/latlong.html b/demos/spinner/latlong.html index 7decacbdc..a99caa67b 100644 --- a/demos/spinner/latlong.html +++ b/demos/spinner/latlong.html @@ -1,4 +1,4 @@ - + diff --git a/demos/spinner/overflow.html b/demos/spinner/overflow.html index 8f489646a..bbdc18437 100644 --- a/demos/spinner/overflow.html +++ b/demos/spinner/overflow.html @@ -1,4 +1,4 @@ - + diff --git a/demos/spinner/time.html b/demos/spinner/time.html index 8c5560507..d92b942dc 100644 --- a/demos/spinner/time.html +++ b/demos/spinner/time.html @@ -1,4 +1,4 @@ - + @@ -24,21 +24,20 @@ _parse: function(value) { if (typeof value == 'string') { - return +Globalization.parseDate(value) + return +$.global.parseDate(value) } return value; }, _format: function() { - this.element.val( Globalization.format(new Date(this.options.value), "t") ); + this.element.val( $.global.format(new Date(this.options.value), "t") ); } }) $(function() { $("#spinner").timespinner(); - $("#culture").change(function() { var current = $("#spinner").timespinner("value"); - Globalization.preferCulture($(this).val()); + $.global.preferCulture($(this).val()); $("#spinner").timespinner("value", current); }); }); -- cgit v1.2.3 From ba4fa2b5ca43827f0deab5c241d0165208e8a4c8 Mon Sep 17 00:00:00 2001 From: jzaefferer Date: Mon, 7 Feb 2011 18:50:19 +0100 Subject: Spinner: Fix unnecessary var --- ui/jquery.ui.spinner.js | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/jquery.ui.spinner.js b/ui/jquery.ui.spinner.js index df61a7494..6d4d10d51 100644 --- a/ui/jquery.ui.spinner.js +++ b/ui/jquery.ui.spinner.js @@ -312,7 +312,6 @@ $.widget('ui.spinner', { }, _format: function(num) { - var num = this.options.value; this.element.val( $.global && this.options.numberformat ? $.global.format(num, this.options.numberformat) : num ); }, -- cgit v1.2.3 From ce51edefb326aa1838c2c62406a2ee2c8efb648a Mon Sep 17 00:00:00 2001 From: jzaefferer Date: Mon, 7 Feb 2011 20:37:06 +0100 Subject: Spinner: Fix time spinner demo; workaround for _super issue. --- ui/jquery.ui.spinner.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ui/jquery.ui.spinner.js b/ui/jquery.ui.spinner.js index 6d4d10d51..0219abb8b 100644 --- a/ui/jquery.ui.spinner.js +++ b/ui/jquery.ui.spinner.js @@ -285,11 +285,16 @@ $.widget('ui.spinner', { this.buttons.button("enable"); } } - this._super( "_setOption", key, value ); + // TODO see below + //this._super( "_setOption", key, value ); + $.Widget.prototype._setOption.apply( this, arguments ); }, _setOptions: function( options ) { - this._super( "_setOptions", options ); + // TODO _super doesn't handle inheritance with more then one subclass + // spinner subclass will have spinner as base, calling spinner._setOptions infinitely + //this._super( "_setOptions", options ); + $.Widget.prototype._setOptions.apply( this, arguments ); if ( "value" in options ) { this._format( this.options.value ); } -- cgit v1.2.3