Skip to content

Commit dcb8f00

Browse files
committed
Progressbar: Add support for setOption with classes
1 parent e3dc04f commit dcb8f00

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

ui/progressbar.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,29 @@ return $.widget( "ui.progressbar", {
9999
Math.min( this.options.max, Math.max( this.min, newValue ) );
100100
},
101101

102+
_elementsFromClassKey: function( classKey ) {
103+
switch( classKey ) {
104+
case "ui-progressbar":
105+
return this.element;
106+
case "ui-progressbar-value":
107+
return this.valueDiv;
108+
case "ui-progressbar-overlay":
109+
if ( this.overlay ) {
110+
return this.overlay;
111+
}
112+
case "ui-progressbar-indeterminate":
113+
if ( !this.value ) {
114+
return this.element
115+
}
116+
case "ui-progressbar-complete":
117+
if ( this.valueDiv.hasClass( classKey ) ) {
118+
return this.valueDiv;
119+
}
120+
default:
121+
return this._superApply( arguments );
122+
}
123+
},
124+
102125
_setOptions: function( options ) {
103126
// Ensure "value" option is set after other values (like max)
104127
var value = options.value;

0 commit comments

Comments
 (0)