enable dark mode

This commit is contained in:
lubiana 2025-06-11 21:44:52 +02:00
parent 1353a57990
commit 89c54af921
Signed by: lubiana
SSH key fingerprint: SHA256:vW1EA0fRR3Fw+dD/sM0K+x3Il2gSry6YRYHqOeQwrfk
2 changed files with 2 additions and 27 deletions

View file

@ -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();
});