]> source.dussan.org Git - jquery-ui.git/commitdiff
Progressbar: Handle disabled option on create, using _setOptionDisabled
authorJörn Zaefferer <joern.zaefferer@gmail.com>
Mon, 21 Sep 2015 10:55:33 +0000 (12:55 +0200)
committerScott González <scott.gonzalez@gmail.com>
Fri, 25 Sep 2015 17:47:07 +0000 (13:47 -0400)
Ref #9151
Ref gh-1599

ui/widgets/progressbar.js

index b2c7259ba033cb6dff4f3845cf749733217bd5ef..7e2695994af1cf95709cc742cd24dc81a455a2cc 100644 (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 );
        },