Changeset 1326
- Timestamp:
- 02/25/2015 08:42:52 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/search.js
r990 r1326 1 1 ( function( $ ) { 2 // Toggle search3 $( '#inner-search .search-section' ).toggle();4 2 3 function toggle_search_bar() { 4 // The search input field. 5 var search_input = $( '#inner-search .search-section .search-field' ); 6 7 // Toggle display. 8 $( '#inner-search .search-section' ).toggle(); 9 10 // Give input field focus if it is now visible, remove focus otherwise. 11 if ( search_input.is(':visible') ) { 12 search_input.focus(); 13 } else { 14 search_input.blur(); 15 } 16 } 17 18 // Toggle search bar on page load (it's shown by default). 19 toggle_search_bar(); 20 21 // Toggle search bar when icon is clicked. 5 22 $( '#inner-search #inner-search-icon' ).on( 'click', function() { 6 $( '#inner-search .search-section' ).toggle();23 toggle_search_bar(); 7 24 }); 25 8 26 } )( jQuery );
Note: See TracChangeset
for help on using the changeset viewer.