Refactor inventory and layout templates: streamline script handling and improve toast message display
This commit is contained in:
parent
ebd2060fd8
commit
3492358645
3 changed files with 94 additions and 91 deletions
|
@ -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>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue