Skip to content
Permalink
Browse files

Accordion: Use ui-accordion-header-active class.

  • Loading branch information...
scottgonzalez committed Jan 31, 2012
1 parent ba43357 commit 6074b0698a01ec52c30eae91dbeb883e8f5432e1
Showing with 9 additions and 10 deletions.
  1. +3 −3 themes/base/jquery.ui.accordion.css
  2. +6 −7 ui/jquery.ui.accordion.js
@@ -9,10 +9,10 @@
*/
/* IE/Win - Fix animation bug - #4615 */
.ui-accordion { width: 100%; }
.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 2px; zoom: 1; }
.ui-accordion .ui-accordion-header-active { border-bottom: 0; }
.ui-accordion .ui-accordion-heading { display: block; font-size: 1em; padding: .5em .5em .5em .7em; }
.ui-accordion-icons .ui-accordion-heading { padding-left: 2.2em; }
.ui-accordion .ui-accordion-header .ui-accordion-header-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
.ui-accordion .ui-accordion-content { padding: 1em 2.2em; overflow: auto; display: none; zoom: 1; }
.ui-accordion .ui-accordion-content-active { display: block; }
@@ -13,7 +13,6 @@
*/
(function( $, undefined ) {

// TODO: use ui-accordion-header-active class and fix styling
$.widget( "ui.accordion", {
version: "@VERSION",
options: {
@@ -58,7 +57,7 @@ $.widget( "ui.accordion", {
options.active += this.headers.length;
}
self.active = self._findActive( options.active )
.addClass( "ui-state-default ui-state-active" )
.addClass( "ui-accordion-header-active ui-state-active" )
.toggleClass( "ui-corner-all" )
.toggleClass( "ui-corner-top" );
self.active.next().addClass( "ui-accordion-content-active" );
@@ -131,7 +130,7 @@ $.widget( "ui.accordion", {
// clean up headers
this.headers
.unbind( ".accordion" )
.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" )
.removeClass( "ui-accordion-header ui-accordion-header-active ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top" )
.removeAttr( "role" )
.removeAttr( "aria-expanded" )
.removeAttr( "aria-selected" )
@@ -335,15 +334,15 @@ $.widget( "ui.accordion", {

// switch classes
active
.removeClass( "ui-state-active ui-corner-top" )
.addClass( "ui-state-default ui-corner-all" )
.removeClass( "ui-accordion-header-active ui-state-active ui-corner-top" )
.addClass( "ui-corner-all" )
.children( ".ui-accordion-header-icon" )
.removeClass( options.icons.activeHeader )
.addClass( options.icons.header );
if ( !clickedIsActive ) {
clicked
.removeClass( "ui-state-default ui-corner-all" )
.addClass( "ui-state-active ui-corner-top" )
.removeClass( "ui-corner-all" )
.addClass( "ui-accordion-header-active ui-state-active ui-corner-top" )
.children( ".ui-accordion-header-icon" )
.removeClass( options.icons.header )
.addClass( options.icons.activeHeader );

0 comments on commit 6074b06

Please sign in to comment.
You can’t perform that action at this time.