@@ -17,11 +17,11 @@ $.widget( "ui.accordion", {
17
17
options : {
18
18
active : 0 ,
19
19
animated : "slide" ,
20
- autoHeight : true ,
21
- clearStyle : false ,
20
+ autoHeight : true , //DEPRECATED - use heightStyle: "auto"
21
+ clearStyle : false , //DEPRECATED - use heightStyle: "content"
22
22
collapsible : false ,
23
23
event : "click" ,
24
- fillSpace : false ,
24
+ fillSpace : false , //DEPRECATED - use heightStyle: "fill"
25
25
//heightStyle: "auto",
26
26
header : "> li > :first-child,> :not(li):even" ,
27
27
icons : {
@@ -30,19 +30,6 @@ $.widget( "ui.accordion", {
30
30
}
31
31
} ,
32
32
33
- _mergeHeightStyle : function ( ) {
34
- options = this . options ;
35
-
36
- if ( options . fillSpace )
37
- return "fill" ;
38
-
39
- if ( options . clearStyle )
40
- return "content" ;
41
-
42
- if ( options . autoHeight )
43
- return "auto" ;
44
- } ,
45
-
46
33
_create : function ( ) {
47
34
var self = this ,
48
35
options = self . options ;
@@ -182,13 +169,29 @@ $.widget( "ui.accordion", {
182
169
. css ( "display" , "" )
183
170
. removeAttr ( "role" )
184
171
. removeClass ( "ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled" ) ;
185
- if ( options . heightStyle != "content" ) {
172
+ if ( options . heightStyle !== "content" ) {
186
173
contents . css ( "height" , "" ) ;
187
174
}
188
175
189
176
return $ . Widget . prototype . destroy . call ( this ) ;
190
177
} ,
191
178
179
+ _mergeHeightStyle : function ( ) {
180
+ var options = this . options ;
181
+
182
+ if ( options . fillSpace ) {
183
+ return "fill" ;
184
+ }
185
+
186
+ if ( options . clearStyle ) {
187
+ return "content" ;
188
+ }
189
+
190
+ if ( options . autoHeight ) {
191
+ return "auto" ;
192
+ }
193
+ } ,
194
+
192
195
_setOption : function ( key , value ) {
193
196
$ . Widget . prototype . _setOption . apply ( this , arguments ) ;
194
197
@@ -249,13 +252,15 @@ $.widget( "ui.accordion", {
249
252
var options = this . options ,
250
253
maxHeight ;
251
254
252
- if ( options . heightStyle == "fill" ) {
255
+ if ( options . heightStyle === "fill" ) {
253
256
if ( $ . browser . msie ) {
254
257
var defOverflow = this . element . parent ( ) . css ( "overflow" ) ;
255
258
this . element . parent ( ) . css ( "overflow" , "hidden" ) ;
256
259
}
257
- parent = this . element . parent ( ) ;
258
- maxHeight = parent . height ( ) - parent . children ( ':visible' ) . not ( this . element ) . outerHeight ( true ) ;
260
+ maxHeight = this . element . parent ( ) . height ( ) ;
261
+ this . element . siblings ( ":visible" ) . each ( function ( ) {
262
+ maxHeight -= $ ( this ) . outerHeight ( true ) ;
263
+ } ) ;
259
264
if ( $ . browser . msie ) {
260
265
this . element . parent ( ) . css ( "overflow" , defOverflow ) ;
261
266
}
@@ -270,7 +275,7 @@ $.widget( "ui.accordion", {
270
275
$ ( this ) . innerHeight ( ) + $ ( this ) . height ( ) ) ) ;
271
276
} )
272
277
. css ( "overflow" , "auto" ) ;
273
- } else if ( options . heightStyle == "auto" ) {
278
+ } else if ( options . heightStyle === "auto" ) {
274
279
maxHeight = 0 ;
275
280
this . headers . next ( )
276
281
. each ( function ( ) {
@@ -493,7 +498,7 @@ $.widget( "ui.accordion", {
493
498
return ;
494
499
}
495
500
496
- if ( this . options . heightStyle == "content" ) {
501
+ if ( this . options . heightStyle === "content" ) {
497
502
this . toShow . add ( this . toHide ) . css ( {
498
503
height : "" ,
499
504
overflow : ""
0 commit comments