@@ -24,7 +24,8 @@ $.widget( "ui.accordion", {
24
24
heightStyle : null , // "auto"
25
25
icons : {
26
26
header : "ui-icon-triangle-1-e" ,
27
- headerSelected : "ui-icon-triangle-1-s"
27
+ // TODO: set to "ui-icon-triangle-1-s" in 2.0 (#6835)
28
+ activeHeader : null // "ui-icon-triangle-1-s"
28
29
}
29
30
} ,
30
31
@@ -133,7 +134,7 @@ $.widget( "ui.accordion", {
133
134
. prependTo ( this . headers ) ;
134
135
this . active . children ( ".ui-icon" )
135
136
. toggleClass ( options . icons . header )
136
- . toggleClass ( options . icons . headerSelected ) ;
137
+ . toggleClass ( options . icons . activeHeader ) ;
137
138
this . element . addClass ( "ui-accordion-icons" ) ;
138
139
}
139
140
} ,
@@ -307,7 +308,7 @@ $.widget( "ui.accordion", {
307
308
. removeClass ( "ui-state-active ui-corner-top" )
308
309
. addClass ( "ui-state-default ui-corner-all" )
309
310
. children ( ".ui-icon" )
310
- . removeClass ( options . icons . headerSelected )
311
+ . removeClass ( options . icons . activeHeader )
311
312
. addClass ( options . icons . header ) ;
312
313
this . active . next ( ) . addClass ( "ui-accordion-content-active" ) ;
313
314
var toHide = this . active . next ( ) ,
@@ -361,15 +362,15 @@ $.widget( "ui.accordion", {
361
362
. removeClass ( "ui-state-active ui-corner-top" )
362
363
. addClass ( "ui-state-default ui-corner-all" )
363
364
. children ( ".ui-icon" )
364
- . removeClass ( options . icons . headerSelected )
365
+ . removeClass ( options . icons . activeHeader )
365
366
. addClass ( options . icons . header ) ;
366
367
if ( ! clickedIsActive ) {
367
368
clicked
368
369
. removeClass ( "ui-state-default ui-corner-all" )
369
370
. addClass ( "ui-state-active ui-corner-top" )
370
371
. children ( ".ui-icon" )
371
372
. removeClass ( options . icons . header )
372
- . addClass ( options . icons . headerSelected ) ;
373
+ . addClass ( options . icons . activeHeader ) ;
373
374
clicked
374
375
. next ( )
375
376
. addClass ( "ui-accordion-content-active" ) ;
@@ -626,6 +627,7 @@ $.extend( $.ui.accordion, {
626
627
} ;
627
628
} ( jQuery , jQuery . ui . accordion . prototype ) ) ;
628
629
630
+ // height options
629
631
( function ( $ , prototype ) {
630
632
$ . extend ( prototype . options , {
631
633
autoHeight : true , // use heightStyle: "auto"
@@ -640,6 +642,7 @@ $.extend( $.ui.accordion, {
640
642
_create : function ( ) {
641
643
this . options . heightStyle = this . options . heightStyle ||
642
644
this . _mergeHeightStyle ( ) ;
645
+
643
646
_create . call ( this ) ;
644
647
} ,
645
648
@@ -668,4 +671,16 @@ $.extend( $.ui.accordion, {
668
671
} ) ;
669
672
} ( jQuery , jQuery . ui . accordion . prototype ) ) ;
670
673
674
+ // icon options
675
+ ( function ( $ , prototype ) {
676
+ prototype . options . icons . headerSelected = "ui-icon-triangle-1-s" ;
677
+
678
+ var _createIcons = prototype . _createIcons ;
679
+ prototype . _createIcons = function ( ) {
680
+ this . options . icons . activeHeader = this . options . icons . activeHeader ||
681
+ this . options . icons . headerSelected ;
682
+ _createIcons . call ( this ) ;
683
+ } ;
684
+ } ( jQuery , jQuery . ui . accordion . prototype ) ) ;
685
+
671
686
} ) ( jQuery ) ;
0 commit comments