Progressbar: Handle disabled option on create, using _setOptionDisabled

Ref #9151
Ref gh-1599
This commit is contained in:
Jörn Zaefferer 2015-09-21 12:55:33 +02:00 committed by Scott González
parent 8d031215c6
commit 7ceaa61842

View File

@ -117,13 +117,16 @@ return $.widget( "ui.progressbar", {
// Don't allow a max less than min
value = Math.max( this.min, value );
}
if ( key === "disabled" ) {
this.element.attr( "aria-disabled", value );
this._toggleClass( null, "ui-state-disabled", !!value );
}
this._super( key, value );
},
_setOptionDisabled: function( value ) {
this._super( value );
this.element.attr( "aria-disabled", value );
this._toggleClass( null, "ui-state-disabled", !!value );
},
_percentage: function() {
return this.indeterminate ? 100 : 100 * ( this.options.value - this.min ) / ( this.options.max - this.min );
},