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

ui/widgets/accordion.js

index 78fea52b1fe3c7b756b4f121d889fa18a4415e3b..360ac1700328d297d9b5d34e429c84254fb80dce 100644 (file)
@@ -174,17 +174,19 @@ return $.widget( "ui.accordion", {
                                this._createIcons();
                        }
                }
+       },
+
+       _setOptionDisabled: function( value ) {
+               this._super( value );
+
+               this.element.attr( "aria-disabled", value );
 
                // Support: IE8 Only
                // #5332 / #6059 - opacity doesn't cascade to positioned elements in IE
                // so we need to add the disabled class to the headers and panels
-               if ( key === "disabled" ) {
-                       this.element.attr( "aria-disabled", value );
-
-                       this._toggleClass( null, "ui-state-disabled", !!value );
-                       this._toggleClass( this.headers.add( this.headers.next() ), null, "ui-state-disabled",
-                               !!value );
-               }
+               this._toggleClass( null, "ui-state-disabled", !!value );
+               this._toggleClass( this.headers.add( this.headers.next() ), null, "ui-state-disabled",
+                       !!value );
        },
 
        _keydown: function( event ) {