2013-02-14 23:58:04 +01:00
|
|
|
jQuery(document).ready( function($) {
|
|
|
|
// Expand/Collapse
|
2013-03-29 09:28:58 +01:00
|
|
|
$('.accordion-container').on( 'click keydown', '.accordion-section-title', function(e) {
|
|
|
|
if ( e.type === 'keydown' && 13 !== e.which ) // "return" key
|
2013-02-14 23:58:04 +01:00
|
|
|
return;
|
2013-03-29 09:28:58 +01:00
|
|
|
e.preventDefault(); // Keep this AFTER the key filter above
|
2013-02-14 23:58:04 +01:00
|
|
|
|
2013-03-29 09:28:58 +01:00
|
|
|
var section = $( this ).closest( '.accordion-section' );
|
2013-02-14 23:58:04 +01:00
|
|
|
|
2013-03-29 09:28:58 +01:00
|
|
|
if ( section.hasClass('cannot-expand') )
|
2013-02-14 23:58:04 +01:00
|
|
|
return;
|
|
|
|
|
2013-03-29 10:30:48 +01:00
|
|
|
section.siblings( '.open' ).removeClass( 'open' );
|
2013-03-29 09:28:58 +01:00
|
|
|
section.toggleClass( 'open' );
|
2013-02-14 23:58:04 +01:00
|
|
|
});
|
|
|
|
});
|