1'use strict'; 2 3/* global Reskin, jQuery, Foundation */ 4 5(function ($) { 6 (window.Reskin = { 7 mobileHeader: function() { 8 function hasClass(elem, className) { 9 return new RegExp(' ' + className + ' ').test(' ' + elem.className + ' '); 10 } 11 function toggleClass(elem, className) { 12 var newClass = ' ' + elem.className.replace(/[\t\r\n]/g, ' ') + ' '; 13 if (hasClass(elem, className)) { 14 while (newClass.indexOf(' ' + className + ' ') >= 0) { 15 newClass = newClass.replace(' ' + className + ' ', ' '); 16 } 17 elem.className = newClass.replace(/^\s+|\s+$/g, ''); 18 } else { 19 elem.className += ' ' + className; 20 } 21 } 22 23 // var declarations 24 var mobileNav = document.querySelector('.nav-expand'); 25 var toggleNav = document.querySelector('.main-nav'); 26 var mobileSearch = document.querySelector('.search-expand'); 27 var toggleSearch = document.querySelector('.siteSearchBar'); 28 29 // Mobile nav click function 30 mobileNav.onclick = function (e) { 31 e.preventDefault(); 32 toggleClass(this, 'nav-mobile-open'); 33 toggleClass(toggleNav, 'nav-active'); 34 if ($(mobileSearch).hasClass('search-mobile-open')) { 35 $(mobileSearch).removeClass('search-mobile-open'); 36 $(toggleSearch).removeClass('search-active'); 37 } 38 }; 39 40 // Mobile search click function 41 mobileSearch.onclick = function (e) { 42 e.preventDefault(); 43 toggleClass(this, 'search-mobile-open'); 44 toggleClass(toggleSearch, 'search-active'); 45 if ($(mobileNav).hasClass('nav-mobile-open')) { 46 $(mobileNav).removeClass('nav-mobile-open'); 47 $(toggleNav).removeClass('nav-active'); 48 } 49 }; 50 51 }, 52 returnToTop: function() { 53 // functionality for link that scrolls to top of page 54 $("a.returnTop").on("click", function () { 55 $("html, body").animate({ scrollTop: 0 }, "fast"); 56 return false; 57 }); 58 }, 59 loadTooltips: function () { 60 $('.toolTipster').tooltipster({ 61 contentAsHTML: true, 62 animation: 'grow', 63 delay: 100, 64 delayTouch: 100, 65 interactive: true, 66 maxWidth: 300, 67 trigger: 'custom', 68 triggerOpen: { 69 mouseenter: true, 70 tap: true 71 }, 72 triggerClose: { 73 mouseleave: true, 74 tap: true 75 } 76 }); 77 }, 78 loadFoundation: function () { 79 $(document).foundation(); 80 }, 81 productColumnHeight: function () { 82 $(function () { 83 var $window = $(window); 84 var width = $window.width(); 85 var height = $window.height(); 86 87 setInterval(function () { 88 if ((width != $window.width()) || (height != $window.height())) { 89 width = $window.width(); 90 height = $window.height(); 91 92 console.log("resized!"); 93 $('.products li').foundation('equalizer', 'reflow'); 94 } 95 }, 300); 96 }); 97 }, 98 bindEvents: function () { 99 $(window).on("load", Reskin.mobileHeader); 100 $(window).on("load", Reskin.loadFoundation); 101 $(window).on("load", Reskin.loadTooltips); 102 $(window).on("load", Reskin.returnToTop); 103 //$(window).load(Reskin.productColumnHeight); 104 }, 105 init: function () { 106 Reskin.bindEvents(); 107 } 108 }); 109 $(function () { 110 Reskin.init(); 111 }); 112})(jQuery);
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.