Files
Django_TasksApp/main/food/static/food/quantity.js
T

11 lines
578 B
JavaScript

document.addEventListener('htmx:responseError', (event) => {
if (!event.detail.elt?.closest('.food-quantity-form')) return;
const status = document.getElementById('food-quantity-status');
if (status) status.textContent = 'Quantity could not be updated. Reload the diary and try again.';
});
document.addEventListener('htmx:sendError', (event) => {
if (!event.detail.elt?.closest('.food-quantity-form')) return;
const status = document.getElementById('food-quantity-status');
if (status) status.textContent = 'Connection failed. Reload the diary and try again.';
});