mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-09 20:30:43 +01:00
51 lines
1.5 KiB
JavaScript
51 lines
1.5 KiB
JavaScript
|
jQuery(document).ready( function($) {
|
||
|
// Expand/Collapse
|
||
|
$('.accordion-section-title').on('click keydown', function( event ) {
|
||
|
|
||
|
if ( event.type === 'keydown' && 13 !== event.which ) // enter
|
||
|
return;
|
||
|
|
||
|
var clicked = $( this ).closest( '.accordion-section' );
|
||
|
|
||
|
if ( clicked.hasClass('cannot-expand') )
|
||
|
return;
|
||
|
|
||
|
clicked.closest( '.accordion-container' ).find( '.accordion-section' ).not( clicked ).removeClass( 'open' );
|
||
|
clicked.toggleClass( 'open' );
|
||
|
event.preventDefault();
|
||
|
});
|
||
|
});
|
||
|
jQuery(document).ready( function($) {
|
||
|
// Expand/Collapse
|
||
|
$('.accordion-section-title').on('click keydown', function( event ) {
|
||
|
|
||
|
if ( event.type === 'keydown' && 13 !== event.which ) // enter
|
||
|
return;
|
||
|
|
||
|
var clicked = $( this ).closest( '.accordion-section' );
|
||
|
|
||
|
if ( clicked.hasClass('cannot-expand') )
|
||
|
return;
|
||
|
|
||
|
clicked.closest( '.accordion-container' ).find( '.accordion-section' ).not( clicked ).removeClass( 'open' );
|
||
|
clicked.toggleClass( 'open' );
|
||
|
event.preventDefault();
|
||
|
});
|
||
|
});
|
||
|
jQuery(document).ready( function($) {
|
||
|
// Expand/Collapse
|
||
|
$('.accordion-section-title').on('click keydown', function( event ) {
|
||
|
|
||
|
if ( event.type === 'keydown' && 13 !== event.which ) // enter
|
||
|
return;
|
||
|
|
||
|
var clicked = $( this ).closest( '.accordion-section' );
|
||
|
|
||
|
if ( clicked.hasClass('cannot-expand') )
|
||
|
return;
|
||
|
|
||
|
clicked.closest( '.accordion-container' ).find( '.accordion-section' ).not( clicked ).removeClass( 'open' );
|
||
|
clicked.toggleClass( 'open' );
|
||
|
event.preventDefault();
|
||
|
});
|
||
|
});
|