1/* eslint-disable */ 2if ('querySelector' in document && 'addEventListener' in window) { 3 /** 4 * Execute 5 */ 6 (function () { 7 // @TODO: 904747 - either place right after toggle OR make sure that tab tabs into search when it's open (probably this one since we have another button) 8 // @TODO: 904747 - Add animation with CSS? 9 document.querySelectorAll('.toggle-search').forEach(el => { 10 el.addEventListener('click', ev => { 11 ev.preventDefault(); 12 ev.stopPropagation(); 13 const searchPlaceholder = document.getElementById('search-placeholder'); 14 const searchInput = document.getElementById('searchInput'); 15 if (searchPlaceholder.classList.contains('is-visible')) { 16 searchPlaceholder.classList.remove('is-visible'); 17 } else { 18 searchPlaceholder.classList.add('is-visible'); 19 searchInput.focus(); 20 } 21 }); 22 }); 23 24 // Close open search when pressing esc key 25 document.addEventListener('keydown', function (e) { 26 if (e.key === 'Escape') { 27 const searchPlaceholder = document.getElementById('search-placeholder'); 28 if (searchPlaceholder.classList.contains('is-visible')) { 29 searchPlaceholder.classList.remove('is-visible'); 30 } 31 } 32 }); 33 document.addEventListener('click', function (e) { 34 // Close search when clicking outside the search wrapper 35 const searchPlaceholder = document.getElementById('search-placeholder'); 36 if (searchPlaceholder.classList.contains('is-visible') && !searchPlaceholder.contains(e.target)) { 37 searchPlaceholder.classList.remove('is-visible'); 38 } 39 }); 40 })(); 41} 42/* eslint-enable */
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.