1if (!NodeList.prototype.forEach) { 2 NodeList.prototype.forEach = Array.prototype.forEach; 3} 4if (!HTMLCollection.prototype.forEach) { 5 HTMLCollection.prototype.forEach = Array.prototype.forEach; 6} 7 8 9(function(window) { 10 11 var isMobileMode = function() { 12 return window.innerWidth <= 768; 13 }; 14 15 var getScroll = function() { 16 return window.pageYOffset || document.documentElement.scrollTop; 17 }; 18 19 var onWindowLoad = function() { 20 21 //////////////////////////////////////////////////////////////////////// 22 var header = document.querySelector('header'); 23 var updateHeader = function() { 24 //var topNavHeight = 65; 25 //var mainNavHeight = 0; // 80 26 var headerHeight = header.offsetHeight; 27 var scrollTop = getScroll();//window.pageYOffset || document.documentElement.scrollTop; 28 29 //if (scrollTop >= 65+80) { 30 if (scrollTop > headerHeight) { 31 if (!header.classList.contains('collapsed')) { 32 //header.style.top = '-145px'; 33 header.classList.add('collapsed'); 34 header.classList.add('in'); 35 } 36 } else { 37 header.classList.remove('collapsed'); 38 header.classList.remove('in'); 39 //header.style.top = '0px'; 40 } 41 }; 42 if (!header.classList.contains('stable')) { 43 window.addEventListener('scroll', updateHeader); 44 updateHeader(); 45 } 46
47 //////////////////////////////////////////////////////////////////////// 48 let toggler = document.getElementById('menu-toggler'); 49 let mainMenu = document.getElementById('main-menu'); 50 let topLinks = mainMenu.querySelectorAll('ul > li > a'); 51 let isList = function(el) { 52 return el.parentNode.querySelector('ul'); 53 }; 54 55 let toggleMainMenu = function(e) { 56 e.preventDefault(); 57 mainMenu.classList.toggle('open'); 58 toggler.classList.toggle('open'); 59 60 topLinks.forEach(l=>{ 61 l.parentNode.classList.remove('toggled'); 62 }); 63 }; 64 toggler.addEventListener('click', toggleMainMenu); 65 66 67 topLinks.forEach(link=>{ 68 link.addEventListener('click', function(event){ 69 if (isMobileMode()) { 70 if (isList(link)) { 71 event.preventDefault(); 72 } 73 74 topLinks.forEach(l=>{ 75 if (isList(l)) { 76 if (l != link) { 77 l.parentNode.classList.remove('toggled'); 78 } else { 79 l.parentNode.classList.toggle('toggled'); 80 } 81 } 82 }); 83 } 84 }); 85 }); 86 87
88 //////////////////////////////////////////////////////////////////////// 89 var articleMenu = document.getElementById('article-menu'); 90 if (articleMenu) { 91 var articleDropdown = articleMenu.querySelector('[data-dropdown]'); 92 var toggleArticleMenu = function(e) { 93 e.preventDefault(); 94 //articleDropdown.classList.toggle('open'); 95 articleMenu.classList.toggle('open'); 96 }; 97 98 articleMenu.querySelectorAll('[data-toggle]').forEach(function(el){ 99 el.addEventListener('click', toggleArticleMenu); 100 }); 101 } 102 103 104 //////////////////////////////////////////////////////////////////////// 105 var searchFormWrappers = document.querySelectorAll('.search-form-wrapper'); 106 searchFormWrappers.forEach(function(wrp){ 107 var toggle = wrp.querySelector('.search-form-toggler'); 108 var form = wrp.querySelector('.search-form') 109 toggle.addEventListener('click', function(e){ 110 e.preventDefault(); 111 wrp.classList.add('open'); 112 form.classList.add('open'); 113 }); 114 115 }); 116 117
118 //////////////////////////////////////////////////////////////////////// 119 // fullpage 120 var landing = document.getElementById('landing'); 121 var scrollDirection = 0; 122 var previosScrollTop = 0; 123 var currentScrollIndex = 0; 124 var mobileWidth = 991;//768; 125 126 /* 127 if (landing) { 128 129 //var $fullpage = $('#landing'); 130 var $fullpage = $(landing); 131 //var $fullpage = $(landing); 132 //var $slides = $fullpage.find('.no-scroll__section'); 133 $fullpage.fullpage({ 134 //anchors: ['p1', 'p2', 'p3', 'p4'], 135 //menu: '#menu', 136 sectionSelector: 'section, article, footer', 137 //scrollingSpeed: 900, 138 //easing:'easeOutExpo', 139 navigation: false, 140 //navigationPosition: 'right', 141 responsiveWidth: 991,//..768, 142 143 css3: true, 144 scrollingSpeed: 1300, 145 autoScrolling: true, 146 //fitToSection: true, 147 //fitToSectionDelay: 1000, 148 scrollBar: true,//false, 149 easing: $.easie(0.545, 0.05, 0.45, 0.95), 150 //easing: $.easie(0.761,0,0.317,1),//'easeInOutCubic', 151 //easing: 'easeOutBack',//'easeInOutCubic', 152 153 //fixedElements: 'header, footer', 154 155 //resetSliders: true, 156 //fitToSection: true, 157 //paddingTop: '15px', 158 //paddingBottom: '15px', 159 //offsetSections: true, 160 //scrollOverflow: true, 161 //slidesNavPosition: "top" 162 163 onLeave: function(index, nextIndex, direction){ 164 //console.log('onLeave: ', index, nextIndex, direction); 165 //var $section = $($('.section').get(index-1)); 166 //$section.find('.anim-el').removeClass('anim-act'); 167 //var section = sections[index-1]; 168 //resetSection(section); 169 }, 170 afterLoad: function(anchorLink, index){ 171 //console.log('AfterLoad: ', anchorLink, index); 172 //var $slide = $($slides.get(index-1)); 173 //$slides.removeClass('_section-current'); 174 //$slide.addClass('_section-current'); 175 //var section = sections[index-1]; 176 //activateSection(section); 177 }, 178 179 //afterRender: function(){}, 180 //afterResize: function(width, height){}, 181 //afterResponsive: function(isResponsive){}, 182 //afterSlideLoad: function(section, origin, destination, direction){}, 183 onSlideLeave: function(section, origin, destination, direction){ 184 //console.log('onSlideLeave: ', section, origin, destination, direction); 185 }, 186 afterResponsive: function(isResponsive){ 187 //console.log('afterResponsive'); 188 } 189 190 }); 191 192 }*/ 193 } 194 195 196 197 198 window.addEventListener('load', onWindowLoad); 199 200}(window)); 201 202
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.