mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Accordion: Use ui-accordion-header-active class.
This commit is contained in:
parent
ba43357122
commit
6074b0698a
6
themes/base/jquery.ui.accordion.css
vendored
6
themes/base/jquery.ui.accordion.css
vendored
@ -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
ui/jquery.ui.accordion.js
vendored
13
ui/jquery.ui.accordion.js
vendored
@ -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 );
|
||||
|
Loading…
Reference in New Issue
Block a user