1jQuery.noConflict(); 2jQuery(document).ready(function () { 3 var $window = jQuery(window); 4 var $html = jQuery('html'); 5 var $main = jQuery('.main'); 6 var mobileTriggerWidth = 740; 7 8 if($main.width() < mobileTriggerWidth){ 9 /* Open navigation menu on hamburger click */ 10 jQuery(".mobile-icon.menu").on("click", function(){ 11 $html.toggleClass("mobile-menu-opened"); 12 }); 13 14 /* Open second-level categories */ 15 jQuery(".navigation .has-children").on("click", function(e){ 16 e.preventDefault(); 17 18 var $this = jQuery(this); 19 var categoryId = $this.data("category-id"); 20 21 var $openedChildGroupsWrapper = jQuery(".child-groups-wrapper .opened"); 22 $openedChildGroupsWrapper.removeClass("opened"); 23 24 $selectedCategoryChildGroupsWrapper = jQuery(".child-groups-wrapper[data-main-category-id='" + categoryId + "']"); 25 $selectedCategoryChildGroupsWrapper.addClass("opened") 26 }); 27 28 /* Open main level categories */ 29 jQuery(".main-category-name").on("click", function(){ 30 var $this = jQuery(this); 31 var $currentCategoryWrapper = $this.closest(".child-groups-wrapper"); 32 33 $currentCategoryWrapper.removeClass("opened"); 34 }); 35 36 /* Open third-level categories */ 37 jQuery(".child-groups > li.has-children .child-categories").each(function(){ 38 var $this = jQuery(this); 39 $this.css({"margin-top": -$this.height(), "opacity": 0}); 40 }); 41 42 jQuery(".child-groups > li.has-children > .title").on("click", function(e){ 43 e.preventDefault(); 44 e.stopPropagation(); 45 46 var $this = jQuery(this); 47 var $categoryWrapper = $this.closest("li"); 48 var $childCategories = $this.siblings(".child-categories"); 49 50 if($categoryWrapper.hasClass("opened")){ 51 hideChildCategories($childCategories); 52 } else { 53 showChildCategories($childCategories); 54 } 55 56 return false; 57 }); 58 } 59 60 jQuery('.second-level-category-link').on('click', function (e) { 61 if ($window.width() <= mobileTriggerWidth) { 62 if (e.target.tagName !== 'SPAN') { 63 e.preventDefault(); 64 e.stopPropagation(); 65 66 var $thirdLevelCategoriesWrapper = jQuery(this).closest('.third-level-categories-wrapper'); 67 68 $thirdLevelCategoriesWrapper.stop().toggleClass('is-opened'); 69 $thirdLevelCategoriesWrapper.find('ul').stop().slideToggle(); 70 } 71 } 72 }); 73 74 jQuery('.product-list-mobile-buttons .filter-button').on('click', function () { 75 if ($window.width() <= mobileTriggerWidth) { 76 $html.addClass('filter-opened'); 77 } 78 }); 79 80 jQuery('.mobile-filter-header .close-button').on('click', function () { 81 if ($window.width() <= mobileTriggerWidth) { 82 $html.removeClass('filter-opened'); 83 } 84 }); 85 86 jQuery('.mobile-filter-footer .apply-filters').on('click', function () { 87 if ($window.width() <= mobileTriggerWidth) { 88 $html.removeClass('filter-opened'); 89 } 90 }); 91 92 jQuery('.product-list-mobile-buttons .sort-button').on('click', function () { 93 if ($window.width() <= mobileTriggerWidth) { 94 $html.addClass('sorting-opened'); 95 } 96 }); 97 98 jQuery('.sorting-panel .close-button').on('click', function () { 99 if ($window.width() <= mobileTriggerWidth) { 100 $html.removeClass('sorting-opened'); 101 } 102 }); 103 104 jQuery('.sorting-panel .apply-sorting').on('click', function () { 105 if ($window.width() <= mobileTriggerWidth) { 106 $html.removeClass('sorting-opened'); 107 } 108 }); 109 110 function hideChildCategories($childCategories){ 111 if($childCategories.length){ 112 $childCategories.closest("li").removeClass("opened"); 113 114 $childCategories.clearQueue().stop().animate({ 115 "opacity": "0", 116 "margin-top": "-" + ($childCategories.height() + parseInt($childCategories.css("padding-top")) + parseInt($childCategories.css("padding-bottom"))) + "px" 117 }, 420, function(){ 118 jQuery(this).hide(); 119 }); 120 } 121 } 122 123 function showChildCategories($childCategories){ 124 if($childCategories.length){ 125 $childCategories.closest("li").addClass("opened"); 126 127 $childCategories.clearQueue().stop().show().animate({ 128 "opacity": "1", 129 "margin-top": "0" 130 }, 420); 131 } 132 } 133});
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.