(function () { 'use strict'; function isCategoryEmpty() { const emptySpan = document.querySelector('.list-empty'); return emptySpan && emptySpan.textContent.includes('Brak produktów do wyświetlenia'); } function hideCurrentCategoryInMenu() { try { const links = document.querySelectorAll('a[aria-label][href*="-c"]'); if (!links.length) return; links.forEach(link => { const linkUrl = new URL(link.href, location.origin); const linkPath = linkUrl.pathname.replace(/\/+$/, ''); const currentPath = location.pathname.replace(/\/+$/, ''); if (linkPath === currentPath) { // znajdź sensowny kontener linku w menu const container = link.closest('li, .category-item, .col, .col.align-self-start') || link.parentElement; if (container) { container.style.display = 'none'; console.log('[SKY-HIDE] Ukryto element menu dla pustej kategorii:', link.href); } else { link.style.display = 'none'; console.log('[SKY-HIDE] Ukryto link kategorii:', link.href); } } }); } catch (e) { console.error('[SKY-HIDE] Błąd w hideCurrentCategoryInMenu:', e); } } function runOnceWhenReady() { // tylko jeśli URL wygląda jak strona kategorii if (!/-c\d+/.test(location.href)) return; setTimeout(() => { if (isCategoryEmpty()) { hideCurrentCategoryInMenu(); } else { console.log('[SKY-HIDE] Kategoria niepusta — nic nie robię.'); } }, 300); // lekki delay na załadowanie menu } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', runOnceWhenReady); } else { runOnceWhenReady(); } })();
Darmowa dostawa od 250 PLN

Narzędzia, akcesoria

Liczba produktów: 73
Kategorie
Filtruj
Zastosowano sortowanie: Nazwa (A-Z)