diff options
author | Scott González <scott.gonzalez@gmail.com> | 2012-02-26 21:54:05 -0500 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2012-02-26 21:54:05 -0500 |
commit | 7f533dfb44f9d6807a5526aa7554f0806c544b69 (patch) | |
tree | 23501e4bd1ee8dbcd6d2f4bd5959f6213efb800e /ui/jquery.ui.accordion.js | |
parent | 367da95ba5afcb80bebce75cd529a46004f60381 (diff) | |
download | jquery-ui-7f533dfb44f9d6807a5526aa7554f0806c544b69.tar.gz jquery-ui-7f533dfb44f9d6807a5526aa7554f0806c544b69.zip |
Accordion: Don't toggle icons if the accordion doesn't have icons.
Diffstat (limited to 'ui/jquery.ui.accordion.js')
-rw-r--r-- | ui/jquery.ui.accordion.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/ui/jquery.ui.accordion.js b/ui/jquery.ui.accordion.js index 8731c17ca..00acf2d10 100644 --- a/ui/jquery.ui.accordion.js +++ b/ui/jquery.ui.accordion.js @@ -347,17 +347,23 @@ $.widget( "ui.accordion", { // switch classes active .removeClass( "ui-accordion-header-active ui-state-active ui-corner-top" ) - .addClass( "ui-corner-all" ) - .children( ".ui-accordion-header-icon" ) + .addClass( "ui-corner-all" ); + if ( options.icons ) { + active.children( ".ui-accordion-header-icon" ) .removeClass( options.icons.activeHeader ) .addClass( options.icons.header ); + } + if ( !clickedIsActive ) { clicked .removeClass( "ui-corner-all" ) - .addClass( "ui-accordion-header-active ui-state-active ui-corner-top" ) - .children( ".ui-accordion-header-icon" ) + .addClass( "ui-accordion-header-active ui-state-active ui-corner-top" ); + if ( options.icons ) { + clicked.children( ".ui-accordion-header-icon" ) .removeClass( options.icons.header ) .addClass( options.icons.activeHeader ); + } + clicked .next() .addClass( "ui-accordion-content-active" ); |