Changeset 23856
- Timestamp:
- 03/29/2013 08:28:58 AM (13 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/js/accordion.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/js/accordion.js
r23855 r23856 1 1 jQuery(document).ready( function($) { 2 2 // Expand/Collapse 3 $('.accordion-section-title').on('click keydown', function( event ) { 3 $('.accordion-container').on( 'click keydown', '.accordion-section-title', function(e) { 4 if ( e.type === 'keydown' && 13 !== e.which ) // "return" key 5 return; 6 e.preventDefault(); // Keep this AFTER the key filter above 4 7 5 if ( event.type === 'keydown' && 13 !== event.which ) // enter 6 return; 8 var section = $( this ).closest( '.accordion-section' ); 7 9 8 var clicked = $( this ).closest( '.accordion-section' ); 9 10 if ( clicked.hasClass('cannot-expand') ) 10 if ( section.hasClass('cannot-expand') ) 11 11 return; 12 12 13 clicked.closest( '.accordion-container' ).find( '.accordion-section' ).not( clicked ).removeClass( 'open' ); 14 clicked.toggleClass( 'open' ); 15 event.preventDefault(); 13 section.closest( '.accordion-container' ).find( '.accordion-section' ).not( section ).removeClass( 'open' ); 14 section.toggleClass( 'open' ); 16 15 }); 17 16 });
Note: See TracChangeset
for help on using the changeset viewer.