1window.addEventListener('load', function() { 2 const menuSwitch = document.getElementById('menuSwitch') 3 const menu = document.getElementById('menu') 4 if (menuSwitch) { 5 menuSwitch.addEventListener('click', function() { 6 menuSwitch.classList.toggle('MenuSwitch--active') 7 menu.classList.toggle('Header-nav--active') 8 }) 9 } 10}) 11 12const ePrizeForm = document.querySelector('.Enterprize-Form') 13const switchingButtons = document.querySelectorAll('[data-targetTabName]') 14 15const switchTab = tabSwitch => { 16 // hide active tab 17 const activeTab = document.querySelector('.Tab--active') 18 const activeSwitch = document.querySelector('.TabSwitch--active') 19 if (activeTab) { 20 // remove active class from active Tab 21 activeTab.classList.remove('Tab--active') 22 } 23 if (activeSwitch) { 24 // remove active class from tabSwitch 25 activeSwitch.classList.remove('TabSwitch--active') 26 } 27 // according to data-targetTabName... 28 const targetTabName = tabSwitch.getAttribute('data-targetTabName') 29 // ...select new tab and new active switch... 30 const targetTab = document.querySelector( 31 `.Tab[data-tabName=${targetTabName}]` 32 ) 33 const targetTabSwitch = document.querySelector( 34 `.TabSwitch[data-targetTabName=${targetTabName}]` 35 ) 36 // ...and show tab and make switch active 37 if (targetTab) { 38 targetTab.classList.add('Tab--active') 39 40 if (targetTabName === 'signUp') { 41 if (ePrizeForm) { 42 // and show enterPrize form 43 ePrizeForm.style.display = 'block' 44 } 45 } else { 46 // ... or hide 47 ePrizeForm.style.display = 'none' 48 } 49 } 50 if (targetTabSwitch) { 51 targetTabSwitch.classList.add('TabSwitch--active') 52 } 53} 54 55if (ePrizeForm) { 56 ePrizeForm.style.display = 'none' 57} 58 59if (switchingButtons.length) { 60 switchingButtons.forEach(switchButton => 61 switchButton.addEventListener( 62 'click', 63 () => switchTab(switchButton), 64 false 65 ) 66 ) 67}
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.