PageSourceSearch

https://alix-avien.ru/bitrix/templates/aspro-lite/components/bitrix/news/contacts/script.js

js alix-avien.ru collected 2026-10-06 06:42:36 UTC 4,185 bytes, 120 lines download raw bytes

1$(document).ready(function(){
2    
3    $("#BxNewsTplContactsForm select").change(function(){
4    	$(this).parents("form").submit();
5    	
6    })
7    
8    $('.contacts__filter-select .dropdown-select .dropdown-select__list-item a').on('click', function (e) {
9        e.preventDefault();
10
11        var $select = $(this).closest('.dropdown-select');
12
13        // set current item
14        $select.find('.dropdown-select__list-link--current').removeClass('dropdown-select__list-link--current');
15        $(this).addClass('dropdown-select__list-link--current');
16
17        // change title
18        var $title = $select.find('.dropdown-select__title');
19        $title.find('span').text($(this).text());
20
21        // close
22        $title.trigger('click');
23
24        // section id
25        var id = $(this).data('id');
26
27        if ($select.hasClass('city')) { 
28            // region select
29            var $region = $(this).closest('.contacts__panel-wrapper').find('.dropdown-select.region');
30            var href = $(this).attr('href');
31            
32            if (
33                !id &&
34                $region.length
35            ) { 
36                $currentRegion = $region.find('.dropdown-select__list-link--current');
37                if ($currentRegion.length) { 
38                    id = $region.find('.dropdown-select__list-link--current').data('id');
39                    var href = $region.find('.dropdown-select__list-link--current').attr('href');
40                }
41            }
42
43            var last_id = $select.data('id');
44            last_id = last_id > 0 ? last_id : 0;
45            if (id != last_id) { 
46                $select.data('id', id);
47
48                $.ajax({
49                    url: href,
50                    type: 'POST',
51                    data: {SECTION_ID: id}
52                }).done(function (html) {
53                    var ob = BX.processHTML(html);
54                    $('.contacts__ajax_items')[0].innerHTML = ob.HTML;
55                    BX.ajax.processScripts(ob.SCRIPT);
56                });
57            }
58        }
59    });
60        
61    $('.contacts__filter-select .dropdown-select.region .dropdown-select__list-item a').on('click', function (e) {
62        e.preventDefault();
63        
64        // region section id
65        var id = $(this).data('id');
66
67        // city select
68        var $city = $(this).closest('.contacts__panel-wrapper').find('.dropdown-select.city');
69        if($city.length){
70            var $emptyCity = $city.find('.dropdown-select__list-item a.empty');
71            var $currentCity = $city.find('.dropdown-select__list-link--current');
72            var $visibleCities = $city.find('.dropdown-select__list-item a[data-parent_id=' + id + ']');
73
74            $city.find('.dropdown-select__list-item a').hide();
75            $emptyCity.show();
76
77            if (id) {
78               $visibleCities.show();
79            }
80
81            var bOpenCitySelect = id && $visibleCities.length > 1;
82
83            if (!bOpenCitySelect) {
84                $city.find('.dropdown-select__title').addClass('clicked');
85            }
86            
87            // last region section id
88            var last_id = $currentCity.data('parent_id');
89
90            if (
91                last_id != id
92            ) {
93                if ($visibleCities.length == 1) {
94                    $visibleCities.first().trigger('click');
95                }
96                else { 
97                    $emptyCity.trigger('click');
98                }
99            }
100            else { 
101                $currentCity.trigger('click');
102            }
103
104            if (!bOpenCitySelect) {
105                $city.find('.dropdown-select__title').removeClass('clicked');
106            }
107        }
108    });
109
110    $('.contacts__tabs .tabs .nav-tabs li a').on('click', function () {
111        $content = $(this).closest('.contacts__row').find('.contacts__tab-content');
112
113        if ($(this).attr('href') === '#map') {
114            $content.addClass('contacts__tab-content--map');
115        }
116        else {
117            $content.removeClass('contacts__tab-content--map');
118        }
119    });
120});

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.