Limita il cambio palla solo a inizio set (0-0)
- Aggiunge computed property isPunteggioZeroZero per verificare lo stato del punteggio - Crea metodo cambiaPalla() con validazione che blocca il cambio se il punteggio non è 0-0 - Disabilita il pulsante cambio palla quando il punteggio non è 0-0 - Mostra notifica di avviso se si tenta il cambio palla durante il set - Aggiorna scorciatoia tastiera Ctrl+ArrowLeft per usare la stessa validazione
This commit is contained in:
@@ -149,7 +149,7 @@
|
||||
<w-button @click="apriDialogConfig()">
|
||||
<img src="/gear.png" width="25" />
|
||||
</w-button>
|
||||
<w-button @click="sp.servHome = !sp.servHome">
|
||||
<w-button @click="cambiaPalla" :disabled="!isPunteggioZeroZero">
|
||||
<img src="/serv.png" width="25" />
|
||||
</w-button>
|
||||
<w-confirm top left question="Azzero punteggio ?" cancel="NO" confirm="SI" @confirm="resetta">
|
||||
|
||||
@@ -38,6 +38,11 @@ export default {
|
||||
}
|
||||
this.abilitaTastiSpeciali();
|
||||
},
|
||||
computed: {
|
||||
isPunteggioZeroZero() {
|
||||
return this.sp.punt.home === 0 && this.sp.punt.guest === 0;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
closeApp() {
|
||||
var win = window.open("", "_self");
|
||||
@@ -69,6 +74,13 @@ export default {
|
||||
this.sp.striscia = { home: [0], guest: [0] }
|
||||
this.sp.servizioPrecedente = []
|
||||
},
|
||||
cambiaPalla() {
|
||||
if (!this.isPunteggioZeroZero) {
|
||||
this.$waveui.notify("Cambio palla consentito solo a inizio set (0-0)", "warning");
|
||||
return;
|
||||
}
|
||||
this.sp.servHome = !this.sp.servHome;
|
||||
},
|
||||
incSet(team) {
|
||||
if (this.sp.set[team] == 2) {
|
||||
this.sp.set[team] = 0;
|
||||
@@ -216,7 +228,7 @@ export default {
|
||||
} else if (e.shiftKey && e.key == "ArrowRight") {
|
||||
this.incSet("guest")
|
||||
} else if (e.ctrlKey && e.key == "ArrowLeft") {
|
||||
this.sp.servHome = !this.sp.servHome
|
||||
this.cambiaPalla()
|
||||
} else { return false }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user