1(function ($) { 2 /** 3 * Dropdown 4 */ 5 $(function () { 6 var $dropdown = $('.c-dropdown'); 7 if (!$dropdown.length) { 8 return; 9 } 10 11 $(window).on('click.dropdown', function () { 12 $('.c-dropdown__item').removeClass('is-open'); 13 }); 14 15 $dropdown.each(function () { 16 var $parent = $(this); 17 var $items = $parent.find('.c-dropdown__item'); 18 var target = $parent.data('dropdown-target'); 19 var isFilter = typeof target === 'string' && target.length > 0; 20 21 var $target = $('[data-dropdown-content="' + target + '"]'); 22 var $listItem = $target.find('[data-dropdown-item]'); 23 var filters = {}; 24 var applyFilter = function () { 25 $listItem.show(); 26 if (!Object.keys(filters).length) { 27 return; 28 } 29 30 $.each(filters, function (key, val) { 31 if (!val) { 32 return; 33 } 34 $listItem.not('[data-dropdown-' + key + '="' + val + '"]').hide(); 35 }); 36 } 37 38 $items.each(function () { 39 var $item = $(this); 40 var $current = $item.find('.c-dropdown__current'); 41 // var $list = $item.find('.p-dropdown__list'); 42 var $link = $item.find('[data-dropdown-change]'); 43 var filter = $item.data('dropdown-filter'); 44 45 $current.on('click', function (e) { 46 e.stopPropagation(); 47 48 if ($item.hasClass('is-open')) { 49 $item.removeClass('is-open'); 50 } else { 51 $items.removeClass('is-open'); 52 $item.addClass('is-open'); 53 } 54 }); 55 56 $link.on('click', function () { 57 var change = $(this).data('dropdown-change'); 58 var label = $(this).data('dropdown-label'); 59 60 $link.removeClass('active'); 61 $(this).addClass('active'); 62 63 if (label) { 64 $current.text(label); 65 } 66 67 if (isFilter) { 68 filters[filter] = change; 69 applyFilter(); 70 return false; 71 } 72 }); 73 }); 74 }); 75 }); 76 77 78 $(function () { 79 var $dropdown = $('.c-dropdown__footer'); 80 if (!$dropdown.length) { 81 return; 82 } 83 84 $(window).on('click.c-dropdown__footer-item', function () { 85 $('.c-dropdown__footer-item').removeClass('is-open'); 86 }); 87 88 $dropdown.each(function () { 89 var $parent = $(this); 90 var $items = $parent.find('.c-dropdown__footer-item'); 91 var target = $parent.data('dropdown-target'); 92 var isFilter = typeof target === 'string' && target.length > 0; 93 94 var $target = $('[data-dropdown-content="' + target + '"]'); 95 var $listItem = $target.find('[data-dropdown-item]'); 96 var filters = {}; 97 var applyFilter = function () { 98 $listItem.show(); 99 if (!Object.keys(filters).length) { 100 return; 101 } 102 103 $.each(filters, function (key, val) { 104 if (!val) { 105 return; 106 } 107 $listItem.not('[data-dropdown-' + key + '="' + val + '"]').hide(); 108 }); 109 } 110 111 $items.each(function () { 112 var $item = $(this); 113 var $current = $item.find('.c-dropdown__footer-current'); 114 // var $list = $item.find('.p-dropdown__list'); 115 var $link = $item.find('[data-dropdown-change]'); 116 var filter = $item.data('dropdown-filter'); 117 118 $current.on('click', function (e) { 119 e.stopPropagation(); 120 121 if ($item.hasClass('is-open')) { 122 $item.removeClass('is-open'); 123 } else { 124 $items.removeClass('is-open'); 125 $item.addClass('is-open'); 126 } 127 }); 128 129 $link.on('click', function () { 130 var change = $(this).data('dropdown-change'); 131 var label = $(this).data('dropdown-label'); 132 133 $link.removeClass('active'); 134 $(this).addClass('active'); 135 136 if (label) { 137 $current.text(label); 138 } 139 140 if (isFilter) { 141 filters[filter] = change; 142 applyFilter(); 143 return false;
144 } 145 }); 146 }); 147 }); 148 }); 149 150 151 152 153 154 155 $('.c-header__humBtn-trg').on('click', function () { 156 if ($('#js-header').hasClass('humb-trg')) { 157 $('#js-header').removeClass('humb-trg'); 158 $('#navBar').removeClass('show'); 159 } else { 160 $('#js-header').addClass('humb-trg'); 161 $('#navBar').addClass('show'); 162 //$('#js-header').addClass('trg'); 163 } 164 return false; 165 }); 166 167 168 169})(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.