mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-05 05:25:40 +00:00
fix: focus input addProduct & feedback addObsOrder & openComanda default 'Sem Mesa'
This commit is contained in:
Binary file not shown.
@@ -55,7 +55,7 @@ Comandas
|
||||
<h2>Abrir Comanda</h2>
|
||||
<input type="text" id="name-comanda" name="name-comanda" required placeholder="Nome"><br>
|
||||
<select name="select-mesa" required>
|
||||
<option value="">Selecione um local</option>
|
||||
<option value="1">Sem Mesa</option>
|
||||
|
||||
{% for mesa in mesas %}
|
||||
<option value="{{mesa.id}}">{{mesa.name}}</option>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -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}})"
|
||||
|
||||
@@ -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')
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user