@@ -120,12 +120,12 @@ $.widget( "ui.accordion", {
120
120
} ,
121
121
122
122
_destroy : function ( ) {
123
- var options = this . options ;
124
-
123
+ // clean up main element
125
124
this . element
126
125
. removeClass ( "ui-accordion ui-widget ui-helper-reset" )
127
126
. removeAttr ( "role" ) ;
128
127
128
+ // clean up headers
129
129
this . headers
130
130
. unbind ( ".accordion" )
131
131
. 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" )
@@ -139,11 +139,12 @@ $.widget( "ui.accordion", {
139
139
. removeClass ( "ui-accordion-heading" ) ;
140
140
this . _destroyIcons ( ) ;
141
141
142
+ // clean up content panels
142
143
var contents = this . headers . next ( )
143
144
. css ( "display" , "" )
144
145
. removeAttr ( "role" )
145
146
. removeClass ( "ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled" ) ;
146
- if ( options . heightStyle !== "content" ) {
147
+ if ( this . options . heightStyle !== "content" ) {
147
148
contents . css ( "height" , "" ) ;
148
149
}
149
150
} ,
@@ -211,14 +212,20 @@ $.widget( "ui.accordion", {
211
212
212
213
refresh : function ( ) {
213
214
var options = this . options ,
214
- maxHeight ;
215
+ parent = this . element . parent ( ) ,
216
+ maxHeight ,
217
+ overflow ;
215
218
216
219
if ( options . heightStyle === "fill" ) {
217
- if ( $ . browser . msie ) {
218
- var defOverflow = this . element . parent ( ) . css ( "overflow" ) ;
219
- this . element . parent ( ) . css ( "overflow" , "hidden" ) ;
220
+ // IE 6 treats height like minHeight, so we need to turn off overflow
221
+ // in ordder to get a reliable height
222
+ // we use the minHeight support test because we assume that only
223
+ // browsers that don't support minHeight will treat height as minHeight
224
+ if ( ! $ . support . minHeight ) {
225
+ overflow = parent . css ( "overflow" ) ;
226
+ parent . css ( "overflow" , "hidden" ) ;
220
227
}
221
- maxHeight = this . element . parent ( ) . height ( ) ;
228
+ maxHeight = parent . height ( ) ;
222
229
this . element . siblings ( ":visible" ) . each ( function ( ) {
223
230
var elem = $ ( this ) ,
224
231
position = elem . css ( "position" ) ;
@@ -228,8 +235,8 @@ $.widget( "ui.accordion", {
228
235
}
229
236
maxHeight -= elem . outerHeight ( true ) ;
230
237
} ) ;
231
- if ( $ . browser . msie ) {
232
- this . element . parent ( ) . css ( "overflow" , defOverflow ) ;
238
+ if ( overflow ) {
239
+ parent . css ( "overflow" , overflow ) ;
233
240
}
234
241
235
242
this . headers . each ( function ( ) {
@@ -305,7 +312,6 @@ $.widget( "ui.accordion", {
305
312
this . _toggle ( toShow , toHide , data ) ;
306
313
} ,
307
314
308
- // TODO: add tests/docs for negative values in 2.0 (#6854)
309
315
_findActive : function ( selector ) {
310
316
return typeof selector === "number" ? this . headers . eq ( selector ) : $ ( ) ;
311
317
} ,
0 commit comments