From 89c54af921fe708badeda958c982b6d86a8bfe58 Mon Sep 17 00:00:00 2001 From: lubiana Date: Wed, 11 Jun 2025 21:44:52 +0200 Subject: [PATCH] enable dark mode --- public/assets/js/app.js | 25 ------------------------- templates/base.html.twig | 4 ++-- 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/public/assets/js/app.js b/public/assets/js/app.js index 96827b7..55583f4 100644 --- a/public/assets/js/app.js +++ b/public/assets/js/app.js @@ -118,31 +118,6 @@ document.addEventListener('DOMContentLoaded', function() { } }); - // Handle form submissions in the modal - document.body.addEventListener('htmx:beforeSend', function(event) { - // If the event is from a form inside the modal - if (event.detail.elt.closest('#htmxModalBody')) { - // Add the HX-Request header to the request - event.detail.requestConfig.headers['HX-Request'] = 'true'; - } - }); - - // Handle redirects from HTMX - document.body.addEventListener('htmx:responseError', function(event) { - if (event.detail.xhr.status === 303) { - const redirectUrl = event.detail.xhr.getResponseHeader('HX-Redirect'); - if (redirectUrl) { - // Close the modal - const modal = bootstrap.Modal.getInstance(document.getElementById('htmxModal')); - if (modal) { - modal.hide(); - } - // Redirect to the specified URL - window.location.href = redirectUrl; - } - } - }); - // Initialize number inputs on page load initNumberInputs(); }); diff --git a/templates/base.html.twig b/templates/base.html.twig index 5c64155..17e09f1 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -1,5 +1,5 @@ - + @@ -16,7 +16,7 @@ {% endblock %} -