PageSourceSearch

https://tomorrowsdesign.dk/wp-content/themes/hello-elementor-child/js/custom.js?ver=1789587950

js tomorrowsdesign.dk collected 2026-10-09 04:00:56 UTC 1,789 bytes, 55 lines download raw bytes

1/**
2 * tomorrowsdesign.dk — Custom JS
3 * Version: 1.1.0
4 * Updated: March 2026
5 */
6
7(function ($) {
8    'use strict';
9
10    // ── Accordion Read More/Less Toggle ──────────────────
11    document.addEventListener("DOMContentLoaded", function () {
12
13        const accordions = document.querySelectorAll(".read-toggle-accordion");
14
15        accordions.forEach(function (accordion) {
16
17            const toggleBtn = accordion.querySelector(".elementskit-btn-link");
18            const title     = accordion.querySelector(".ekit-accordion-title");
19
20            if (!toggleBtn || !title) return;
21
22            const OPEN_TEXT   = "Læs mindre";
23            const CLOSED_TEXT = "Læs mere";
24
25            function updateText() {
26                const expanded = toggleBtn.getAttribute("aria-expanded") === "true";
27                title.textContent = expanded ? OPEN_TEXT : CLOSED_TEXT;
28            }
29
30            // Set initial state
31            updateText();
32
33            // Listen for click
34            toggleBtn.addEventListener("click", function () {
35                setTimeout(updateText, 50); // wait for aria state change
36            });
37
38        });
39
40        // ── WooCommerce Cart Drawer Auto-Open ─────────────
41        // Opens cart drawer when product added via URL parameter
42        var url = window.location.href;
43        if (url.indexOf("add-to-cart") > -1) {
44            if ($(document).width() < 768) {
45                // Mobile — open mobile cart popup
46                $('.mobile-cart-popup .elementor-menu-cart__toggle a').click();
47            } else {
48                // Desktop — open cart drawer
49                $("#elementor-menu-cart__toggle_button").click();
50            }
51        }
52
53    });
54
55})(jQuery);

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.