|
@@ -49,8 +49,8 @@ function prenotatiWorker(worker, prenotato) {
|
|
|
notify("sbrigati: siamo al " + e.data)
|
|
|
worker.postMessage({cmd: "close"})
|
|
|
} else {
|
|
|
- var field = document.querySelector('#tuonumero');
|
|
|
- field.value = e.data
|
|
|
+ var field = document.querySelector('#now');
|
|
|
+ field.textContent = e.data
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -100,18 +100,20 @@ function inizializzaNumero() {
|
|
|
|
|
|
inizializzaNumero()
|
|
|
|
|
|
- document.getElementById('btn-prenotati').onclick = function () {
|
|
|
+ var btn = document.getElementById('btn-prenotati')
|
|
|
+ btn.onclick = function () {
|
|
|
var val = document.querySelector('#form > input').value
|
|
|
initNotify()
|
|
|
var field = document.querySelector('#tuonumero');
|
|
|
field.setAttribute('disabled', 'disabled')
|
|
|
+ document.getElementById('now-section').classList.remove('hide')
|
|
|
+ btn.setAttribute('disabled', 'disabled')
|
|
|
var value = parseInt(val,10)
|
|
|
if(SERVICEWORKER) {
|
|
|
prenotatiWorker(webSocketWorker, value)
|
|
|
} else {
|
|
|
prenotati(value)
|
|
|
}
|
|
|
- field.value = ""
|
|
|
}
|
|
|
})()
|
|
|
|