1$(document).ready(function () { 2 /* --- Bind mobile filter --- */ 3 var $mobilefilter = $("#mobilefilter"); 4 var $mobiledMenu = $("#mobilemenu"); 5 if ($mobilefilter.length) { 6 $mobilefilter.isOpen = $mobiledMenu.hasClass("show"); 7 $mobilefilter.isAppendLeft = false; 8 $mobilefilter.isWrapFilter = false; 9 $mobilefilter.isHorizontalOrCompact = $(".filter_horizontal").length || $(".bx_filter_vertical.compact").length; 10 $mobilefilter.close = '<i class="svg svg-close close-icons"></i>'; 11 12 $(document).on("click", ".bx-filter-title", function () { 13 OpenMobileFilter(); 14 }); 15 16 $(document).on("click", "#mobilefilter .svg-close.close-icons", function () { 17 CloseMobileFilter(); 18 }); 19 20 $(document).on("click", ".bx_filter_select_block", function (e) { 21 var bx_filter_select_container = $(e.target).parents(".bx_filter_select_container"); 22 if (bx_filter_select_container.length) { 23 var prop_id = bx_filter_select_container.closest(".bx_filter_parameters_box").attr("data-property_id"); 24 if ($("#smartFilterDropDown" + prop_id).length) { 25 $("#smartFilterDropDown" + prop_id).css({ 26 "max-width": bx_filter_select_container.width(), 27 "z-index": "3020", 28 }); 29 } 30 } 31 }); 32 33 $(document).on("click", ".bx_filter_search_button", function (e) { 34 // if ($(e.target).hasClass("bx_filter_search_button")) { 35 CloseMobileFilter(); 36 // } 37 }); 38 39 $(document).on("mouseup", ".bx_filter_parameters_box_title", function (e) { 40 $("[id^='smartFilterDropDown']").hide(); 41 if ($(e.target).hasClass("close-icons")) { 42 CloseMobileFilter(); 43 } 44 }); 45 46 $mobilefilter.parent().append('<div id="mobilefilter-overlay"></div>'); 47 var $mobilefilterOverlay = $("#mobilefilter-overlay"); 48 49 $mobilefilterOverlay.click(function () { 50 if ($mobilefilter.isOpen) { 51 CloseMobileFilter(); 52 //e.stopPropagation(); 53 } 54 }); 55 56 mobileFilterNum = function (num, def) { 57 if (def) { 58 $(".bx_filter_search_button").val(num); 59 } else { 60 var str = ""; 61 var $prosLeng = $(".bx_filter_parameters_box > span"); 62 63 str += 64 $prosLeng.data("f") + 65 " " + 66 num 67 // " " + 68 // declOfNumFilter(num, [$prosLeng.data("fi"), $prosLeng.data("fr"), $prosLeng.data("frm")]); 69 $(".bx_filter_search_button").val(str); 70 } 71 }; 72 73 declOfNumFilter = function (number, titles) { 74 cases = [2, 0, 1, 1, 1, 2]; 75 return titles[number % 100 > 4 && number % 100 < 20 ? 2 : cases[number % 10 < 5 ? number % 10 : 5]]; 76 }; 77 78 OpenMobileFilter = function () { 79 if (!$mobilefilter.isOpen) { 80 $("body").addClass("jqm-initied wf"); 81 82 $(".bx_filter_vertical .slide-block__head.filter_title").removeClass("closed"); 83 84 $(".bx_filter_vertical .slide-block__head.filter_title + .slide-block__body").show(); 85 86 if (!$mobilefilter.isAppendLeft) { 87 if (!$mobilefilter.isWrapFilter) { 88 $(".bx_filter").wrap("<div id='wrapInlineFilter'></div>"); 89 $mobilefilter.isWrapFilter = true; 90 } 91 $(".bx_filter").appendTo($("#mobilefilter")); 92 var helper = $("#filter-helper"); 93 if (helper.length) { 94 helper.prependTo($("#mobilefilter .bx_filter_parameters")); 95 } 96 $mobilefilter.isAppendLeft = true; 97 } 98 if (typeof checkFilterLandgings === "function") { 99 checkFilterLandgings(); 100 } 101 102 $("#mobilefilter .bx_filter_parameters").addClass("mobile-scroll scrollbar"); 103 104 $(".bx_filter_button_box.ajax-btns").addClass("colored_theme_bg"); 105 $(".bx_filter_button_box.ajax-btns .filter-bnt-wrapper").removeClass("hidden"); 106 107 // show overlay 108 setTimeout(function () { 109 $mobilefilterOverlay.fadeIn("fast"); 110 }, 100); 111 112 // fix body 113 $("body").css({ overflow: "hidden", height: "100vh" });
114 115 // show mobile filter 116 $mobilefilter.addClass("show"); 117 $mobilefilter.find(".bx_filter").css({ display: "block" }); 118 $mobilefilter.isOpen = true; 119 120 $("#mobilefilter .bx_filter_button_box.btns.ajax-btns").removeClass("hidden"); 121 122 var init = $mobilefilter.data("init"); 123 if (typeof init === "undefined") { 124 $mobilefilter.scroll(function () { 125 $(".bx_filter_section .bx_filter_select_container").each(function () { 126 var prop_id = $(this).closest(".bx_filter_parameters_box").attr("data-property_id"); 127 if ($("#smartFilterDropDown" + prop_id).length) { 128 $("#smartFilterDropDown" + prop_id).hide(); 129 } 130 }); 131 }); 132 133 $mobilefilter.data("init", "Y"); 134 } 135 } 136 }; 137 138 CloseMobileFilter = function (append) { 139 $mobilefilter.find(".bx_filter_parameters").removeClass("scrollbar"); 140 141 $("body").removeClass("jqm-initied wf"); 142 143 $(".bx_filter:not(.n-ajax) .bx_filter_button_box.ajax-btns .filter-bnt-wrapper").addClass("hidden"); 144 145 if ($mobilefilter.isOpen) { 146 // scroll to top 147 $mobilefilter.find(".bx_filter_parameters").scrollTop(0); 148 149 // unfix body 150 $("body").css({ overflow: "", height: "" }); 151 152 // hide overlay 153 setTimeout(function () { 154 $mobilefilterOverlay.fadeOut("fast"); 155 }, 100); 156 157 // hide mobile filter 158 $mobilefilter.removeClass("show"); 159 $mobilefilter.isOpen = false; 160 } 161 162 if (append && $mobilefilter.isAppendLeft) { 163 $("#mobilefilter .bx_filter_parameters_box_title").removeClass("opened"); 164 $("#mobilefilter .bx_filter_block.dropdown-menu-wrapper").hide(); 165 166 $(".bx_filter").appendTo($("#wrapInlineFilter")).show(); 167 var helper = $("#filter-helper"); 168 if (helper.length) { 169 helper.appendTo($("#filter-helper-wrapper")); 170 } 171 $mobilefilter.isAppendLeft = false; 172 $mobilefilter.removeData("init"); 173 // mobileFilterNum($("#modef_num_mobile"), true); 174 } 175 }; 176 177 checkMobileFilter = function () { 178 if ( 179 (!window.matchMedia("(max-width: 991px)").matches && !$mobilefilter.isHorizontalOrCompact) || 180 (!window.matchMedia("(max-width: 767px)").matches && $mobilefilter.isHorizontalOrCompact) 181 ) { 182 CloseMobileFilter(true); 183 } 184 }; 185 } 186 /* --- END Bind mobile filter --- */ 187});
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.