fix: focus input addProduct & feedback addObsOrder & openComanda default 'Sem Mesa'

This commit is contained in:
2025-06-25 12:06:59 -03:00
parent b73e134d9e
commit d7013f0ab8
6 changed files with 11 additions and 3 deletions

View File

@@ -14,7 +14,7 @@
{{item.product.name}}
{% if item.product.cuisine == True %}
<input hidden id="{{item.id}}-obsOrder" type="order" value="{{item.id | obsOrder}}">
<span data-tooltip="{{item.id | obsOrder}}" data-flow="top">
<span id="tooltip-id-{{item.id}}" data-tooltip="{{item.id | obsOrder}}" data-flow="top">
<img
onclick="openModalObs({{item.id}})"

View File

@@ -3,8 +3,12 @@
function openModal() {
textField = document.getElementById('search-product')
if (textField) {
setTimeout(() => {
textField.focus();
}, 100); // 50ms de delay (ajuste conforme necessário)
}
textField.value = '';
textField.focus()
}
@@ -251,7 +255,9 @@ function troco(){
function addOrder(){
obs = document.getElementById('obs')
id = document.getElementById('id-temp').value
var obsPrint = document.getElementById(id+'-obsOrder')
tooltipObs = document.getElementById('tooltip-id-'+id)
fetch(`/comandas/editOrders/${id}/${obs.value}`, {
@@ -266,11 +272,13 @@ function addOrder(){
showToast('✅Pedido atualizado com sucesso!😁','success')
tooltipObs.dataset.tooltip = data.obs
obs.value = ''
obsPrint.value = data.obs
document.getElementById('modal-obs').style.display = 'none';
}
})
.catch(error => {
console.log(error)
showToast('❌Ocorreu um erro!😢','error')
});