1$(document).ready(function(){ 2 $('.contacts__filter-select .dropdown-select .dropdown-select__list-item a').on('click', function (e) { 3 e.preventDefault(); 4 5 var $select = $(this).closest('.dropdown-select'); 6 7 // set current item 8 $select.find('.dropdown-select__list-link--current').removeClass('dropdown-select__list-link--current'); 9 $(this).addClass('dropdown-select__list-link--current'); 10 11 // change title 12 var $title = $select.find('.dropdown-select__title'); 13 $title.find('span').text($(this).text()); 14 15 // close 16 $title.trigger('click'); 17 18 if ($select.hasClass('city')) { 19 // section id 20 var id = $(this).data('id'); 21 22 // region select 23 var $region = $(this).closest('.contacts__panel-wrapper').find('.dropdown-select.region'); 24 var href = $(this).attr('href'); 25 26 if ( 27 !id && 28 $region.length 29 ) { 30 $currentRegion = $region.find('.dropdown-select__list-link--current'); 31 if ($currentRegion.length) { 32 id = $region.find('.dropdown-select__list-link--current').data('id'); 33 var href = $region.find('.dropdown-select__list-link--current').attr('href'); 34 } 35 } 36 37 var last_id = $select.data('id'); 38 last_id = last_id > 0 ? last_id : 0; 39 if (id != last_id) { 40 $select.data('id', id); 41 42 // data2send 43 var data = { 44 SECTION_ID: id 45 }; 46 47 var $specialiation = $(this).closest('.contacts__panel-wrapper').find('.dropdown-select.specialization'); 48 if($specialiation.length){ 49 data.SPECIALIZATION = $specialiation.data('id'); 50 } 51 52 $.ajax({ 53 url: href, 54 type: 'GET', 55 data: data, 56 }).done(function (html) { 57 var ob = BX.processHTML(html); 58 $('.contacts__ajax_items')[0].innerHTML = ob.HTML; 59 BX.ajax.processScripts(ob.SCRIPT); 60 }); 61 } 62 } 63 64 if ($select.hasClass('specialization')) { 65 // specialization enum id 66 var id = $(this).data('id'); 67 68 var last_id = $select.data('id'); 69 last_id = last_id > 0 ? last_id : 0; 70 if (id != last_id) { 71 $select.data('id', id); 72 73 // section id 74 var sectionId = false; 75 76 // url 77 var href = location.href; 78 79 // city select 80 var $city = $(this).closest('.contacts__panel-wrapper').find('.dropdown-select.city'); 81 if($city.length){ 82 sectionId = $city.data('id'); 83 href = $city.attr('href'); 84 } 85 86 // region select 87 var $region = $(this).closest('.contacts__panel-wrapper').find('.dropdown-select.region'); 88 89 if ( 90 !sectionId && 91 $region.length 92 ) { 93 $currentRegion = $region.find('.dropdown-select__list-link--current'); 94 if ($currentRegion.length) { 95 sectionId = $region.find('.dropdown-select__list-link--current').data('id'); 96 href = $region.find('.dropdown-select__list-link--current').attr('href'); 97 } 98 } 99 100 $.ajax({ 101 url: href, 102 type: 'POST', 103 data: { 104 SECTION_ID: sectionId, 105 SPECIALIZATION: id, 106 } 107 }).done(function (html) { 108 var ob = BX.processHTML(html); 109 $('.contacts__ajax_items')[0].innerHTML = ob.HTML; 110 BX.ajax.processScripts(ob.SCRIPT); 111 }); 112 } 113 } 114 }); 115 116 $('.contacts__filter-select .dropdown-select.region .dropdown-select__list-item a').on('click', function (e) { 117 e.preventDefault(); 118 119 // region section id 120 var id = $(this).data('id'); 121 122 // city select 123 var $city = $(this).closest('.contacts__panel-wrapper').find('.dropdown-select.city'); 124 if($city.length){ 125 var $emptyCity = $city.find('.dropdown-select__list-item a.empty'); 126 var $currentCity = $city.find('.dropdown-select__list-link--current'); 127 var $visibleCities = $city.find('.dropdown-select__list-item a[data-parent_id=' + id + ']'); 128 129 $city.find('.dropdown-select__list-item a').hide(); 130 $emptyCity.show(); 131 132 if (id) { 133 $visibleCities.show(); 134 } 135 136 var bOpenCitySelect = id && $visibleCities.length > 1; 137 138 if (!bOpenCitySelect) { 139 $city.find('.dropdown-select__title').addClass('clicked'); 140 } 141 142 // last region section id 143 var last_id = $currentCity.data('parent_id'); 144 145 if ( 146 last_id != id 147 ) { 148 if ($visibleCities.length == 1) { 149 $visibleCities.first().trigger('click'); 150 } 151 else { 152 $emptyCity.trigger('click'); 153 } 154 } 155 else { 156 $currentCity.trigger('click'); 157 } 158 159 if (!bOpenCitySelect) { 160 $city.find('.dropdown-select__title').removeClass('clicked'); 161 } 162 } 163 }); 164 165 $('.contacts__tabs .tabs .nav-tabs li a').on('click', function () { 166 $content = $(this).closest('.contacts__row').find('.contacts__tab-content'); 167 168 if ($(this).attr('href') === '#map') { 169 $content.addClass('contacts__tab-content--map'); 170 } 171 else { 172 $content.removeClass('contacts__tab-content--map'); 173 } 174 }); 175});
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.