From 7ceaa618421dc2be3bdb5f5cf8f62d499e982244 Mon Sep 17 00:00:00 2001 From: Jörn Zaefferer Date: Mon, 21 Sep 2015 12:55:33 +0200 Subject: Progressbar: Handle disabled option on create, using _setOptionDisabled Ref #9151 Ref gh-1599 --- ui/widgets/progressbar.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'ui/widgets') diff --git a/ui/widgets/progressbar.js b/ui/widgets/progressbar.js index b2c7259ba..7e2695994 100644 --- a/ui/widgets/progressbar.js +++ b/ui/widgets/progressbar.js @@ -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 ); }, -- cgit v1.2.3