@@ -144,23 +144,21 @@ $.widget("ui.accordion", {
144144
145145 this . element
146146 . removeClass ( "ui-accordion ui-widget ui-helper-reset" )
147- . removeAttr ( "role" )
148- . unbind ( '.accordion' )
149- . removeData ( 'accordion' ) ;
147+ . removeAttr ( "role" ) ;
150148
151149 this . headers
152150 . unbind ( ".accordion" )
153- . removeClass ( "ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-corner-top" )
151+ . removeClass ( "ui-accordion-header ui-accordion-disabled ui- helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top" )
154152 . removeAttr ( "role" ) . removeAttr ( "aria-expanded" ) . removeAttr ( "tabIndex" ) ;
155153
156154 this . headers . find ( "a" ) . removeAttr ( "tabIndex" ) ;
157155 this . _destroyIcons ( ) ;
158- var contents = this . headers . next ( ) . css ( "display" , "" ) . removeAttr ( "role" ) . removeClass ( "ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active" ) ;
156+ var contents = this . headers . next ( ) . css ( "display" , "" ) . removeAttr ( "role" ) . removeClass ( "ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled " ) ;
159157 if ( o . autoHeight || o . fillHeight ) {
160158 contents . css ( "height" , "" ) ;
161159 }
162160
163- return this ;
161+ return $ . Widget . prototype . destroy . call ( this ) ;
164162 } ,
165163
166164 _setOption : function ( key , value ) {
@@ -175,7 +173,13 @@ $.widget("ui.accordion", {
175173 this . _createIcons ( ) ;
176174 }
177175 }
178-
176+ // #5332 - opacity doesn't cascade to positioned elements in IE
177+ // so we need to add the disabled class to the headers and panels
178+ if ( key == "disabled" ) {
179+ this . headers . add ( this . headers . next ( ) )
180+ [ value ? "addClass" : "removeClass" ] (
181+ "ui-accordion-disabled ui-state-disabled" ) ;
182+ }
179183 } ,
180184
181185 _keydown : function ( event ) {
0 commit comments