PageSourceSearch

https://specialtykava.si/wp-content/themes/jnews/assets/js/new-js/popup-handler.js

js specialtykava.si collected 2026-10-02 21:19:08 UTC 1,688 bytes, 47 lines download raw bytes

1// popup-handler.js
2
3document.addEventListener('DOMContentLoaded', function () {
4    // var openPopupButton = document.getElementById('openPopup1');
5    // if (openPopupButton) {
6    //     openPopupButton.addEventListener('click', function () {
7    //         document.getElementById('popup1').classList.add('active');
8    //     });
9    // }
10
11    var closePopupButton = document.getElementById('closePopup1');
12    if (closePopupButton) {
13        closePopupButton.addEventListener('click', function () {
14            document.getElementById('popup1').classList.remove('active');
15        });
16    }
17
18    var menuLink = document.querySelector('.openPopupMenu a');
19
20    if (menuLink) {
21        menuLink.addEventListener('click', function (e) {
22            e.preventDefault();
23            document.getElementById('popup1').classList.add('active');
24        });
25    }
26
27    var bookNowLinks = document.querySelectorAll('a[href="#book-now"]');
28    if (bookNowLinks.length) {
29        bookNowLinks.forEach(function (link) {
30            link.addEventListener('click', function (e) {
31                var target = document.getElementById('book-now');
32                if (!target) {
33                    return;
34                }
35
36                e.preventDefault();
37
38                // scroll-margin-top on #book-now / .book-now-block handles header offset
39                target.scrollIntoView({ behavior: 'smooth', block: 'start' });
40
41                if (window.history && typeof window.history.replaceState === 'function') {
42                    window.history.replaceState(null, '', '#book-now');
43                }
44            });
45        });
46    }
47});

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.