From 840c466b0c221bef1761199ff92723d639955597 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Gruszczy=C5=84ski?= Date: Thu, 14 Aug 2025 16:19:11 +0200 Subject: [PATCH] modal w panelu admina --- static/js/preview_list_modal.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/static/js/preview_list_modal.js b/static/js/preview_list_modal.js index 7f904fa..31dabfd 100644 --- a/static/js/preview_list_modal.js +++ b/static/js/preview_list_modal.js @@ -2,6 +2,12 @@ document.addEventListener("DOMContentLoaded", function () { const modalElement = document.getElementById("productPreviewModal"); const modal = new bootstrap.Modal(modalElement); + modalElement.addEventListener('hidden.bs.modal', function () { + document.querySelectorAll('.modal-backdrop').forEach(el => el.remove()); + document.body.classList.remove('modal-open'); + document.body.style.overflow = ''; + }); + document.querySelectorAll(".preview-btn").forEach((btn) => { btn.addEventListener("click", async () => { const listId = btn.dataset.listId; @@ -71,4 +77,4 @@ document.addEventListener("DOMContentLoaded", function () { } }); }); -}); +}); \ No newline at end of file