PageSourceSearch

https://themepure.net/wp-content/themes/marketplace/assets/js/ma-account.js?ver=1.0.0

js themepure.net collected 2026-10-03 19:36:27 UTC 2,709 bytes, 66 lines download raw bytes

1/* My Account — sidebar toggle + password visibility */
2(function () {
3    'use strict';
4
5    // ── Sidebar toggle ────────────────────────────────────────────────────────
6    var toggle  = document.getElementById('ma-sidebar-toggle');
7    var sidebar = document.getElementById('ma-sidebar');
8    var overlay = document.getElementById('ma-sidebar-overlay');
9
10    if (toggle && sidebar && overlay) {
11        function openSidebar() {
12            sidebar.classList.add('is-open');
13            overlay.classList.add('is-visible');
14            toggle.classList.add('is-open');
15            toggle.setAttribute('aria-expanded', 'true');
16            document.body.style.overflow = 'hidden';
17        }
18
19        function closeSidebar() {
20            sidebar.classList.remove('is-open');
21            overlay.classList.remove('is-visible');
22            toggle.classList.remove('is-open');
23            toggle.setAttribute('aria-expanded', 'false');
24            document.body.style.overflow = '';
25        }
26
27        toggle.addEventListener('click', function () {
28            sidebar.classList.contains('is-open') ? closeSidebar() : openSidebar();
29        });
30
31        overlay.addEventListener('click', closeSidebar);
32
33        document.addEventListener('keydown', function (e) {
34            if (e.key === 'Escape' && sidebar.classList.contains('is-open')) {
35                closeSidebar();
36                toggle.focus();
37            }
38        });
39
40        // Close sidebar when a nav link is tapped on mobile
41        sidebar.querySelectorAll('.ma-nav__link').forEach(function (link) {
42            link.addEventListener('click', function () {
43                if (window.innerWidth < 992) closeSidebar();
44            });
45        });
46    }
47
48    // ── Password visibility toggle ────────────────────────────────────────────
49    document.querySelectorAll('.ma-form__pw-toggle').forEach(function (btn) {
50        btn.addEventListener('click', function () {
51            var wrap  = btn.closest('.ma-form__password-wrap');
52            var input = wrap && wrap.querySelector('input');
53            if (!input) return;
54
55            var isHidden = input.type === 'password';
56            input.type   = isHidden ? 'text' : 'password';
57            btn.setAttribute('aria-label', isHidden ? 'Hide password' : 'Show password');
58
59            var icon = btn.querySelector('i');
60            if (icon) {
61                icon.className = isHidden ? 'fa-solid fa-eye-slash' : 'fa-solid fa-eye';
62            }
63        });
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.