mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-25 18:48:57 +01:00
4dd2707c60
see #23890 git-svn-id: http://core.svn.wordpress.org/trunk@23858 1a063a9b-81f0-0310-95a4-ce76da25c4cd
17 lines
497 B
JavaScript
17 lines
497 B
JavaScript
jQuery(document).ready( function($) {
|
|
// Expand/Collapse
|
|
$('.accordion-container').on( 'click keydown', '.accordion-section-title', function(e) {
|
|
if ( e.type === 'keydown' && 13 !== e.which ) // "return" key
|
|
return;
|
|
e.preventDefault(); // Keep this AFTER the key filter above
|
|
|
|
var section = $( this ).closest( '.accordion-section' );
|
|
|
|
if ( section.hasClass('cannot-expand') )
|
|
return;
|
|
|
|
section.siblings( '.open' ).removeClass( 'open' );
|
|
section.toggleClass( 'open' );
|
|
});
|
|
});
|