1jQuery(function($){ 2 3 if($('.site-container').length) { 4 // initialize Slideout. 5 var slideout = new Slideout({ 6 'panel': $('.site-container').get(0), 7 'menu': $('.side-menu').get(0), 8 'padding': 276, // width of the slideout menu 9 'touch': false, 10 // 'side': 'right' // open the menu from right 11 }); 12 13 // open and close the side menu by clicking on the hamburger button. 14 var $hamburger = $('.hamburger'); 15 16 $hamburger.on('click', function(e) { 17 slideout.toggle(); 18 }); 19 20 // open and close the side menu by clicking on the hamburger button. 21 var $hamburger = $('.search-btn'); 22 23 $hamburger.on('click', function(e) { 24 slideout.toggle(); 25 }); 26 27 28 // Toggle Slideout when .close-icon is tapped. 29 $('.close-icon').on('click', function () { 30 slideout.close(); 31 }); 32 33 // add an overlay on the open panel to close the side menu on click. 34 function close(eve) { 35 eve.preventDefault(); 36 slideout.close(); 37 } 38 39 slideout 40 .on('beforeopen', function() { 41 this.panel.classList.add('panel-open'); 42 }) 43 .on('open', function() { 44 this.panel.addEventListener('click', close); 45 }) 46 .on('beforeclose', function() { 47 this.panel.classList.remove('panel-open'); 48 this.panel.removeEventListener('click', close); 49 $hamburger.removeClass('is-active'); 50 }); 51 52 $(window).resize(function(){ 53 if(window.innerWidth > 768) { 54 $(".side-menu .menu, .side-menu .sub-menu").removeAttr("style"); 55 $(".side-menu > .menu-item").removeClass("menu-open"); 56 } 57 }); 58 59 $(".side-menu .menu-item").click(function(event){ 60 if (event.target !== this) 61 return; 62 $(this).find(".sub-menu:first").slideToggle(function() { 63 $(this).parent().toggleClass("menu-open"); 64 }); 65 }); 66} 67 68});
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.