ukrycie sekcji paragonow

This commit is contained in:
Mateusz Gruszczyński
2025-07-09 17:04:34 +02:00
parent 4c91c1842f
commit c96a0763a7
2 changed files with 24 additions and 2 deletions

View File

@@ -238,3 +238,22 @@ function updateListSmoothly(newItems) {
updateProgressBar();
}
document.addEventListener("DOMContentLoaded", function() {
const receiptSection = document.getElementById("receiptSection");
const toggleBtn = document.querySelector('[data-bs-target="#receiptSection"]');
if (!receiptSection || !toggleBtn) return;
if (localStorage.getItem("receiptSectionOpen") === "true") {
new bootstrap.Collapse(receiptSection, { toggle: true });
}
receiptSection.addEventListener('shown.bs.collapse', function () {
localStorage.setItem("receiptSectionOpen", "true");
});
receiptSection.addEventListener('hidden.bs.collapse', function () {
localStorage.setItem("receiptSectionOpen", "false");
});
});