PageSourceSearch

https://ritual.ru/local/templates/ritual/js/mobile_menu.js?1790857616

js ritual.ru collected 2026-10-01 12:27:22 UTC 2,199 bytes, 66 lines download raw bytes

1$(document).ready(function() {
2 //   const COUNTER_ID = 35788610;
3
4    $('.newmobilebtns__item2').each(function() {
5        var $btn = $(this);
6        var phone = $btn.attr('href');
7        var btnId = $btn.attr('id');
8        
9        console.log($btn)
10        console.log(phone)
11
12        $btn.data('phone', phone).removeAttr('href').css('cursor', 'pointer');
13
14        var $dropdown = $(
15            '<div class="custom-dropdown ' + btnId + '">' +
16            //'<a href="' + phone + '" class="dropdown-link action-call">Позвонить</a>' +
17            '<div class="dropdown-link action-call action-call-wrap">Позвонить<a href="' + phone + '" class="dropdown-link dropdown-link-opacity0 roistat-phone action-call">Позвонить</a></div>' +
18            '<div class="dropdown-link action-write">Написать</div>' +
19            '</div>'
20        );
21
22        $btn.append($dropdown);
23    });
24
25
26    $('.newmobilebtns__item2').on('click', function(e) {
27        var $btn = $(this);
28        var btnId = $btn.attr('id');
29        var $target = $(e.target);
30        var $menu = $btn.find('.custom-dropdown');
31
32
33        if ($target.hasClass('action-call')) {
34            console.log(btnId)
35            ym(35788610, 'reachGoal', btnId + '_phone');
36            $menu.hide();
37            return;
38        }
39        
40        if ($target.hasClass('action-write')) {
41            console.log(btnId)
42            e.preventDefault();
43            e.stopPropagation();
44            ym(35788610, 'reachGoal', btnId + '_write');
45         //   document.dispatchEvent(new CustomEvent("popups:open"));
46            document.querySelector('chat-24').shadowRoot.querySelector('.widget .messengers button').click() 
47            $menu.hide();
48            return;
49        }
50
51        e.preventDefault();
52        if ($menu.is(':visible')) {
53            $menu.fadeOut(150);
54        } else {
55            $('.custom-dropdown').hide();
56          //  ym(COUNTER_ID, 'reachGoal', btnId);
57            $menu.fadeIn(150);
58        }
59    });
60
61    $(document).on('click', function(e) {
62        if (!$(e.target).closest('.newmobilebtns__item2').length) {
63            $('.custom-dropdown').fadeOut(150);
64        }
65    });
66});

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.