bug: toast

This commit is contained in:
2025-02-21 21:45:18 -03:00
parent 8a58d0a0db
commit d15c58f4e7
5 changed files with 48 additions and 5 deletions

View File

@@ -197,7 +197,27 @@ function addOrder(){
})
}
function showToastAdd(message, type ,duration = 3000) {
const toast = document.getElementById('toast-add');
if (type === 'success') {
toast.style.backgroundColor = '#28a745';
} else if (type === 'error') {
toast.style.backgroundColor = '#dc3545';
} else if (type === 'info') {
toast.style.backgroundColor = '#ffc107';
}
const toastMessage = document.getElementById('toast-message-add');
toastMessage.textContent = message;
toast.classList.add('show');
setTimeout(() => {
toast.classList.remove('show');
}, duration);
}
function addProductComanda(productId,comandaId, cuisine) {
obs = document.getElementById('obs');
console.log(obs.value);
@@ -220,7 +240,7 @@ function addProductComanda(productId,comandaId, cuisine) {
listProductsBalcaoElement.innerHTML = text;
})
showToast('Produto adicionado com sucesso!😁','success');
showToastAdd('Produto adicionado com sucesso!😁','success');
}
}