1jQuery(function($) { 2 3 // Define Theme specific functions 4 var Theme = { 5 // Swiping mobile galleries wwith Hammer.js 6 swipeGallery: function() { 7 setTimeout(function() { 8 var touchGallery = document.getElementsByClassName("fancybox-wrap")[0]; 9 var mc = new Hammer(touchGallery); 10 mc.on("panleft panright", function(ev) { 11 if (ev.type == "panleft") { 12 $("a.fancybox-next").trigger("click"); 13 } else if (ev.type == "panright") { 14 $("a.fancybox-prev").trigger("click"); 15 } 16 Theme.swipeGallery(); 17 }); 18 }, 500); 19 }, 20 swipeInit: function() { 21 if ('ontouchstart' in window) { 22 $("body").on("click", "a.w-fancybox", function() { 23 Theme.swipeGallery(); 24 }); 25 } 26 // Add fullwidth class to gallery thumbs if less than 6 27 $('.imageGallery').each(function(){ 28 if ($(this).children('div').length <= 6) { 29 $(this).children('div').addClass('fullwidth-mobile'); 30 } 31 }); 32 }, 33 toggleClick: function(click, target, classname){ 34 $(click).click(function(){ 35 $(target).toggleClass(classname); 36 }); 37 }, 38 // Interval function to execute post-post-load events 39 interval: function(condition, action, duration, limit) { 40 var counter = 0; 41 var looper = setInterval(function(){ 42 if (counter >= limit || Theme.checkElement(condition)) { 43 clearInterval(looper); 44 } else { 45 action(); 46 counter++; 47 } 48 }, duration); 49 }, 50 checkElement: function(selector) { 51 return $(selector).length; 52 }, 53 moveLogin: function() { 54 var login = $("#member-login"); 55 login.detach().appendTo("#navmobile .wsite-menu-default"); 56 }, 57 setPosition: function(){ 58 $("#wrapper").height() < $(window).height() ? $("#wrapper").css({"position": "absolute"}) : $("#wrapper").css({"position": "relative"}); 59 }, 60 cartDisplay: function() { 61 if (Number($('#wsite-nav-cart-num').text()) > 0 ) { 62 $('#wsite-mini-cart').addClass('full'); 63 $('#footer').addClass('footer-full'); 64 } 65 else { 66 $('#wsite-mini-cart').removeClass('full'); 67 $('#footer').removeClass('footer-full'); 68 } 69 } 70 } 71 72 $(document).ready(function() { 73 $("body").addClass("postload"); 74 Theme.swipeInit(); 75 Theme.toggleClick(".wsite-com-sidebar", ".wsite-com-sidebar", "sidebar-expanded"); 76 Theme.toggleClick(".hamburger", "body", "menu-open"); 77 Theme.interval("#wsite-mini-cart.full", Theme.cartDisplay, 800, 10); 78 $('.wsite-product-button, #wsite-com-product-add-to-cart, .wsite-product-item .wsite-remove-button').on('click', function(){ 79 setTimeout(function() { Theme.cartDisplay(); }, 800); 80 }); 81 $(".navmobile-wrapper").css({ "padding-top" : $("#header").outerHeight() + 20 + "px"}); 82 if ($(window).width() <= 1024) { 83 Theme.moveLogin(); 84 Theme.setPosition(); 85 // Add fullwidth class to gallery thumbs if less than 6 86 $('.imageGallery').each(function(){ 87 if ($(this).children('div').length <= 6) { 88 $(this).children('div').addClass('fullwidth-mobile'); 89 } 90 }); 91 } 92 93 94 }); 95});
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.