]> source.dussan.org Git - jquery-ui.git/commitdiff
Progressbar: hidden instance in ui(), options._interval->this._interval
authorChi Cheng <cloudream@gmail.com>
Mon, 25 Aug 2008 05:47:48 +0000 (05:47 +0000)
committerChi Cheng <cloudream@gmail.com>
Mon, 25 Aug 2008 05:47:48 +0000 (05:47 +0000)
Update spinner/progressbar demos

demos/functional/templates/ui.progressbar.html
demos/functional/templates/ui.spinner.html
ui/ui.progressbar.js

index 00aa2f9dec3bbde948f22414d0811a72081299a9..cb99c33a9c39adbfe10159be58bb0f7d87fd9671 100644 (file)
                                destroy: '$("#progressbar").progressbar("destroy");',\r
                                options: [\r
                                        { desc: 'Start a progressbar', source: '$("#progressbar").progressbar({interval:2000}); $("#progressbar").progressbar("start");' },\r
-                                       { desc: 'With different increment', source: '$("#progressbar").progressbar({interval:2000, increment:100}); $("#progressbar").progressbar("start");' },\r
-                                       { desc: 'Set progress to 50%', source: '$("#progressbar").progressbar("progress", 50);' },\r
-                                       { desc: 'Loop', source: '$("#progressbar").progressbar({interval:2000}).progressbar("start");' },\r
+                                       { desc: 'With different increment', source: '$("#progressbar").progressbar({interval:2000, increment:100}).progressbar("start");' },\r
+                                       { desc: 'Set progress to 50%', source: '$("#progressbar").progressbar().progressbar("progress", 50);' },\r
                                        { desc: 'Callback when finish', source: '$("#progressbar").progressbar({interval: 1000, stop:function(){alert("Finished");}}).progressbar("start");' },\r
-                                       { desc: 'Enable the progressbar', source: '$("#progressbar").progressbar("enable");' },\r
-                                       { desc: 'Disable the progressbar', source: '$("#progressbar").progressbar("disable");' }\r
+                                       { desc: 'Enable the progressbar', source: '$("#progressbar").progressbar().progressbar("enable");' },\r
+                                       { desc: 'Disable the progressbar', source: '$("#progressbar").progressbar().progressbar("disable");' }\r
                                ]\r
                        }\r
 \r
index 4ec12cc94de2195627a5b42a2144d4878efb66ec..727fb8d4454e17214206532ad2293671cff909e5 100644 (file)
                                        { desc: 'Make a spinner', source: '$("#spinner").spinner();' },\r
                                        { desc: 'A spinner with min and max value', source: '$("#spinner").spinner({min:-100, max:150});' },\r
                                        { desc: 'Big stepping', source: '$("#spinner").spinner({stepping:100});' },\r
+                                       { desc: 'Currency option', source: '$("#spinner").spinner({currency:"$"});' },\r
                                        { desc: 'Disable incremental option', source: '$("#spinner").spinner({incremental:false});' },\r
-                                       { desc: 'Enable the spinner', source: '$("#spinner").spinner().attr("disabled","");' },\r
-                                       { desc: 'Disable the spinner', source: '$("#spinner").spinner().attr("disabled","disabled");' }\r
+                                       { desc: 'Enable the spinner', source: '$("#spinner").spinner().spinner("disable");' },\r
+                                       { desc: 'Disable the spinner', source: '$("#spinner").spinner().spinner("enable");' }\r
                                ]\r
                        }\r
 \r
index 755cbe40ae1671ea026252b805cc64a8d93fd272..abbf174d0d22561904f46527e07e1ada79efb9ff 100644 (file)
@@ -15,9 +15,7 @@
 $.widget("ui.progressbar", {\r
        _init: function() {\r
 \r
-               $.extend(this.options, {\r
-                       _interval: this.options.interval\r
-               });\r
+               this._interval = this.options.interval;\r
 \r
                var self = this,\r
                        options = this.options,\r
@@ -59,7 +57,6 @@ $.widget("ui.progressbar", {
        plugins: {},\r
        ui: function(e) {\r
                return {\r
-                       instance: this,\r
                        identifier: this.identifier,\r
                        options: this.options,\r
                        element: this.bar,\r
@@ -151,7 +148,7 @@ $.widget("ui.progressbar", {
                this.bar.width(0);\r
                this.textElement.width(0);\r
                this.bar.addClass('ui-hidden');\r
-               this.options.interval = this.options._interval;\r
+               this.options.interval = this._interval;\r
                this._propagate('stop', this.ui());\r
        },\r
        progress: function(percentState) {\r