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