Refactor inventory and layout templates: streamline script handling and improve toast message display

This commit is contained in:
Yaro Kasear 2025-07-07 10:23:07 -05:00
parent ebd2060fd8
commit 3492358645
3 changed files with 94 additions and 91 deletions

View file

@ -78,7 +78,16 @@
searchInput.addEventListener('input', () => {
searchButton.disabled = searchInput.value.trim() === '';
});
{% block script %} {% endblock %}
document.addEventListener("DOMContentLoaded", () => {
const toastData = localStorage.getItem("toastMessage");
if (toastData) {
const { message, type } = JSON.parse(toastData);
renderToast({ message, type });
localStorage.removeItem("toastMessage");
}
{% block script %} {% endblock %}
});
</script>
</body>