mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Progressbar: hidden instance in ui(), options._interval->this._interval
Update spinner/progressbar demos
This commit is contained in:
parent
5d261bf7b1
commit
75bfb681b9
@ -15,12 +15,11 @@
|
|||||||
destroy: '$("#progressbar").progressbar("destroy");',
|
destroy: '$("#progressbar").progressbar("destroy");',
|
||||||
options: [
|
options: [
|
||||||
{ desc: 'Start a progressbar', source: '$("#progressbar").progressbar({interval:2000}); $("#progressbar").progressbar("start");' },
|
{ desc: 'Start a progressbar', source: '$("#progressbar").progressbar({interval:2000}); $("#progressbar").progressbar("start");' },
|
||||||
{ desc: 'With different increment', source: '$("#progressbar").progressbar({interval:2000, increment:100}); $("#progressbar").progressbar("start");' },
|
{ desc: 'With different increment', source: '$("#progressbar").progressbar({interval:2000, increment:100}).progressbar("start");' },
|
||||||
{ desc: 'Set progress to 50%', source: '$("#progressbar").progressbar("progress", 50);' },
|
{ desc: 'Set progress to 50%', source: '$("#progressbar").progressbar().progressbar("progress", 50);' },
|
||||||
{ desc: 'Loop', source: '$("#progressbar").progressbar({interval:2000}).progressbar("start");' },
|
|
||||||
{ desc: 'Callback when finish', source: '$("#progressbar").progressbar({interval: 1000, stop:function(){alert("Finished");}}).progressbar("start");' },
|
{ desc: 'Callback when finish', source: '$("#progressbar").progressbar({interval: 1000, stop:function(){alert("Finished");}}).progressbar("start");' },
|
||||||
{ desc: 'Enable the progressbar', source: '$("#progressbar").progressbar("enable");' },
|
{ desc: 'Enable the progressbar', source: '$("#progressbar").progressbar().progressbar("enable");' },
|
||||||
{ desc: 'Disable the progressbar', source: '$("#progressbar").progressbar("disable");' }
|
{ desc: 'Disable the progressbar', source: '$("#progressbar").progressbar().progressbar("disable");' }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,9 +17,10 @@
|
|||||||
{ desc: 'Make a spinner', source: '$("#spinner").spinner();' },
|
{ desc: 'Make a spinner', source: '$("#spinner").spinner();' },
|
||||||
{ desc: 'A spinner with min and max value', source: '$("#spinner").spinner({min:-100, max:150});' },
|
{ desc: 'A spinner with min and max value', source: '$("#spinner").spinner({min:-100, max:150});' },
|
||||||
{ desc: 'Big stepping', source: '$("#spinner").spinner({stepping:100});' },
|
{ desc: 'Big stepping', source: '$("#spinner").spinner({stepping:100});' },
|
||||||
|
{ desc: 'Currency option', source: '$("#spinner").spinner({currency:"$"});' },
|
||||||
{ desc: 'Disable incremental option', source: '$("#spinner").spinner({incremental:false});' },
|
{ desc: 'Disable incremental option', source: '$("#spinner").spinner({incremental:false});' },
|
||||||
{ desc: 'Enable the spinner', source: '$("#spinner").spinner().attr("disabled","");' },
|
{ desc: 'Enable the spinner', source: '$("#spinner").spinner().spinner("disable");' },
|
||||||
{ desc: 'Disable the spinner', source: '$("#spinner").spinner().attr("disabled","disabled");' }
|
{ desc: 'Disable the spinner', source: '$("#spinner").spinner().spinner("enable");' }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,9 +15,7 @@
|
|||||||
$.widget("ui.progressbar", {
|
$.widget("ui.progressbar", {
|
||||||
_init: function() {
|
_init: function() {
|
||||||
|
|
||||||
$.extend(this.options, {
|
this._interval = this.options.interval;
|
||||||
_interval: this.options.interval
|
|
||||||
});
|
|
||||||
|
|
||||||
var self = this,
|
var self = this,
|
||||||
options = this.options,
|
options = this.options,
|
||||||
@ -59,7 +57,6 @@ $.widget("ui.progressbar", {
|
|||||||
plugins: {},
|
plugins: {},
|
||||||
ui: function(e) {
|
ui: function(e) {
|
||||||
return {
|
return {
|
||||||
instance: this,
|
|
||||||
identifier: this.identifier,
|
identifier: this.identifier,
|
||||||
options: this.options,
|
options: this.options,
|
||||||
element: this.bar,
|
element: this.bar,
|
||||||
@ -151,7 +148,7 @@ $.widget("ui.progressbar", {
|
|||||||
this.bar.width(0);
|
this.bar.width(0);
|
||||||
this.textElement.width(0);
|
this.textElement.width(0);
|
||||||
this.bar.addClass('ui-hidden');
|
this.bar.addClass('ui-hidden');
|
||||||
this.options.interval = this.options._interval;
|
this.options.interval = this._interval;
|
||||||
this._propagate('stop', this.ui());
|
this._propagate('stop', this.ui());
|
||||||
},
|
},
|
||||||
progress: function(percentState) {
|
progress: function(percentState) {
|
||||||
|
Loading…
Reference in New Issue
Block a user