diff options
author | Alex Dovenmuehle <adovenmuehle@gmail.com> | 2011-01-11 15:38:47 -0500 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2011-01-11 15:38:47 -0500 |
commit | b6ed9328ef5254cae18c6f96bdd467c195f1e2fa (patch) | |
tree | 517f17e0b267b3a713cd06e092ab89d86f91812d /ui/jquery.ui.accordion.js | |
parent | 04667b15180ddbbc88af9a0fe30ace91aef2ae15 (diff) | |
download | jquery-ui-b6ed9328ef5254cae18c6f96bdd467c195f1e2fa.tar.gz jquery-ui-b6ed9328ef5254cae18c6f96bdd467c195f1e2fa.zip |
Accordion: Deprecated icons.headerSelected in favor of icons.activeHeader. Fixes #6834 - Accordion: Change icons.headerSelected to icons.activeHeader.
Diffstat (limited to 'ui/jquery.ui.accordion.js')
-rw-r--r-- | ui/jquery.ui.accordion.js | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/ui/jquery.ui.accordion.js b/ui/jquery.ui.accordion.js index 064d8dc91..f7d0e27b2 100644 --- a/ui/jquery.ui.accordion.js +++ b/ui/jquery.ui.accordion.js @@ -24,7 +24,8 @@ $.widget( "ui.accordion", { heightStyle: null, // "auto" icons: { header: "ui-icon-triangle-1-e", - headerSelected: "ui-icon-triangle-1-s" + // TODO: set to "ui-icon-triangle-1-s" in 2.0 (#6835) + activeHeader: null // "ui-icon-triangle-1-s" } }, @@ -133,7 +134,7 @@ $.widget( "ui.accordion", { .prependTo( this.headers ); this.active.children( ".ui-icon" ) .toggleClass(options.icons.header) - .toggleClass(options.icons.headerSelected); + .toggleClass(options.icons.activeHeader); this.element.addClass( "ui-accordion-icons" ); } }, @@ -307,7 +308,7 @@ $.widget( "ui.accordion", { .removeClass( "ui-state-active ui-corner-top" ) .addClass( "ui-state-default ui-corner-all" ) .children( ".ui-icon" ) - .removeClass( options.icons.headerSelected ) + .removeClass( options.icons.activeHeader ) .addClass( options.icons.header ); this.active.next().addClass( "ui-accordion-content-active" ); var toHide = this.active.next(), @@ -361,7 +362,7 @@ $.widget( "ui.accordion", { .removeClass( "ui-state-active ui-corner-top" ) .addClass( "ui-state-default ui-corner-all" ) .children( ".ui-icon" ) - .removeClass( options.icons.headerSelected ) + .removeClass( options.icons.activeHeader ) .addClass( options.icons.header ); if ( !clickedIsActive ) { clicked @@ -369,7 +370,7 @@ $.widget( "ui.accordion", { .addClass( "ui-state-active ui-corner-top" ) .children( ".ui-icon" ) .removeClass( options.icons.header ) - .addClass( options.icons.headerSelected ); + .addClass( options.icons.activeHeader ); clicked .next() .addClass( "ui-accordion-content-active" ); @@ -626,6 +627,7 @@ $.extend( $.ui.accordion, { }; }( jQuery, jQuery.ui.accordion.prototype ) ); +// height options (function( $, prototype ) { $.extend( prototype.options, { autoHeight: true, // use heightStyle: "auto" @@ -640,6 +642,7 @@ $.extend( $.ui.accordion, { _create: function() { this.options.heightStyle = this.options.heightStyle || this._mergeHeightStyle(); + _create.call( this ); }, @@ -668,4 +671,16 @@ $.extend( $.ui.accordion, { }); }( jQuery, jQuery.ui.accordion.prototype ) ); +// icon options +(function( $, prototype ) { + prototype.options.icons.headerSelected = "ui-icon-triangle-1-s"; + + var _createIcons = prototype._createIcons; + prototype._createIcons = function() { + this.options.icons.activeHeader = this.options.icons.activeHeader || + this.options.icons.headerSelected; + _createIcons.call( this ); + }; +}( jQuery, jQuery.ui.accordion.prototype ) ); + })( jQuery ); |