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 // section id 19 var id = $(this).data('id'); 20 21 if ($select.hasClass('city')) { 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 $.ajax({
43 url: href, 44 type: 'POST', 45 data: {SECTION_ID: id} 46 }).done(function (html) { 47 var ob = BX.processHTML(html); 48 $('.contacts__ajax_items')[0].innerHTML = ob.HTML; 49 BX.ajax.processScripts(ob.SCRIPT); 50 }); 51 } 52 } 53 }); 54 55 $('.contacts__filter-select .dropdown-select.region .dropdown-select__list-item a').on('click', function (e) { 56 e.preventDefault(); 57 58 // region section id 59 var id = $(this).data('id'); 60 61 // city select 62 var $city = $(this).closest('.contacts__panel-wrapper').find('.dropdown-select.city'); 63 if($city.length){ 64 var $emptyCity = $city.find('.dropdown-select__list-item a.empty'); 65 var $currentCity = $city.find('.dropdown-select__list-link--current'); 66 var $visibleCities = $city.find('.dropdown-select__list-item a[data-parent_id=' + id + ']'); 67 68 $city.find('.dropdown-select__list-item a').hide(); 69 $emptyCity.show(); 70 71 if (id) { 72 $visibleCities.show(); 73 } 74 75 var bOpenCitySelect = id && $visibleCities.length > 1; 76 77 if (!bOpenCitySelect) { 78 $city.find('.dropdown-select__title').addClass('clicked'); 79 } 80 81 // last region section id 82 var last_id = $currentCity.data('parent_id'); 83 84 if ( 85 last_id != id 86 ) { 87 if ($visibleCities.length == 1) { 88 $visibleCities.first().trigger('click'); 89 } 90 else { 91 $emptyCity.trigger('click'); 92 } 93 } 94 else { 95 $currentCity.trigger('click'); 96 } 97 98 if (!bOpenCitySelect) { 99 $city.find('.dropdown-select__title').removeClass('clicked'); 100 } 101 } 102 }); 103 104 $('.contacts__tabs .tabs .nav-tabs li a').on('click', function () { 105 $content = $(this).closest('.contacts__row').find('.contacts__tab-content'); 106 107 if ($(this).attr('href') === '#map') { 108 $content.addClass('contacts__tab-content--map'); 109 } 110 else { 111 $content.removeClass('contacts__tab-content--map'); 112 } 113 }); 114});
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.