@@ -17,13 +17,11 @@ $.widget( "ui.accordion", {
17
17
options : {
18
18
active : 0 ,
19
19
animated : "slide" ,
20
- autoHeight : true , //DEPRECATED - use heightStyle: "auto"
21
- clearStyle : false , //DEPRECATED - use heightStyle: "content"
22
20
collapsible : false ,
23
21
event : "click" ,
24
- fillSpace : false , //DEPRECATED - use heightStyle: "fill"
25
- //heightStyle: "auto",
26
22
header : "> li > :first-child,> :not(li):even" ,
23
+ // TODO: set to "auto" in 2.0 (#5868, #5872)
24
+ heightStyle : null , // "auto"
27
25
icons : {
28
26
header : "ui-icon-triangle-1-e" ,
29
27
headerSelected : "ui-icon-triangle-1-s"
@@ -34,9 +32,6 @@ $.widget( "ui.accordion", {
34
32
var self = this ,
35
33
options = self . options ;
36
34
37
- //Merge autoheight, fillSpace and clearStyle
38
- options . heightStyle = options . heightStyle || self . _mergeHeightStyle ( ) ;
39
-
40
35
self . running = 0 ;
41
36
42
37
self . element
@@ -176,30 +171,9 @@ $.widget( "ui.accordion", {
176
171
return $ . Widget . prototype . destroy . call ( this ) ;
177
172
} ,
178
173
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
-
195
174
_setOption : function ( key , value ) {
196
175
$ . Widget . prototype . _setOption . apply ( this , arguments ) ;
197
176
198
- // handle deprecated options
199
- // TODO: remove in 2.0
200
- if ( key === "autoHeight" || key === "clearStyle" || key === "fillSpace" ) {
201
- this . options . heightStyle = this . _mergeHeightStyle ( ) ;
202
- }
203
177
if ( key == "active" ) {
204
178
this . activate ( value ) ;
205
179
}
@@ -626,7 +600,7 @@ $.extend( $.ui.accordion, {
626
600
return this . href . toLowerCase ( ) === location . href . toLowerCase ( ) ;
627
601
}
628
602
} ) ;
629
-
603
+
630
604
var _create = prototype . _create ;
631
605
prototype . _create = function ( ) {
632
606
if ( this . options . navigation ) {
@@ -648,6 +622,48 @@ $.extend( $.ui.accordion, {
648
622
}
649
623
_create . call ( this ) ;
650
624
} ;
651
- } ( jQuery , jQuery . ui . accordion . prototype ) ) ;
625
+ } ( jQuery , jQuery . ui . accordion . prototype ) ) ;
626
+
627
+ ( function ( $ , prototype ) {
628
+ $ . extend ( prototype . options , {
629
+ autoHeight : true , // use heightStyle: "auto"
630
+ clearStyle : false , // use heightStyle: "content"
631
+ fillSpace : false // use heightStyle: "fill"
632
+ } ) ;
633
+
634
+ var _create = prototype . _create ,
635
+ _setOption = prototype . _setOption ;
636
+
637
+ $ . extend ( prototype , {
638
+ _create : function ( ) {
639
+ this . options . heightStyle = this . options . heightStyle ||
640
+ this . _mergeHeightStyle ( ) ;
641
+ _create . call ( this ) ;
642
+ } ,
643
+
644
+ _setOption : function ( key , value ) {
645
+ if ( key === "autoHeight" || key === "clearStyle" || key === "fillSpace" ) {
646
+ this . options . heightStyle = this . _mergeHeightStyle ( ) ;
647
+ }
648
+ _setOption . apply ( this , arguments ) ;
649
+ } ,
650
+
651
+ _mergeHeightStyle : function ( ) {
652
+ var options = this . options ;
653
+
654
+ if ( options . fillSpace ) {
655
+ return "fill" ;
656
+ }
657
+
658
+ if ( options . clearStyle ) {
659
+ return "content" ;
660
+ }
661
+
662
+ if ( options . autoHeight ) {
663
+ return "auto" ;
664
+ }
665
+ }
666
+ } ) ;
667
+ } ( jQuery , jQuery . ui . accordion . prototype ) ) ;
652
668
653
669
} ) ( jQuery ) ;
0 commit comments