Skip to content

Commit 874b4a0

Browse files
jzaeffererscottgonzalez
authored andcommitted
Accordion: Handle disabled option on create, through _setOptionDisabled
Ref #9151 Ref jquerygh-1599
1 parent 7dde5c9 commit 874b4a0

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

ui/widgets/accordion.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -174,17 +174,19 @@ return $.widget( "ui.accordion", {
174174
this._createIcons();
175175
}
176176
}
177+
},
178+
179+
_setOptionDisabled: function( value ) {
180+
this._super( value );
181+
182+
this.element.attr( "aria-disabled", value );
177183

178184
// Support: IE8 Only
179185
// #5332 / #6059 - opacity doesn't cascade to positioned elements in IE
180186
// so we need to add the disabled class to the headers and panels
181-
if ( key === "disabled" ) {
182-
this.element.attr( "aria-disabled", value );
183-
184-
this._toggleClass( null, "ui-state-disabled", !!value );
185-
this._toggleClass( this.headers.add( this.headers.next() ), null, "ui-state-disabled",
186-
!!value );
187-
}
187+
this._toggleClass( null, "ui-state-disabled", !!value );
188+
this._toggleClass( this.headers.add( this.headers.next() ), null, "ui-state-disabled",
189+
!!value );
188190
},
189191

190192
_keydown: function( event ) {

0 commit comments

Comments
 (0)