From cd8b74e1b0b9fdda90cbd1f1b86cc3e3b4d66e3d Mon Sep 17 00:00:00 2001 From: Adrien Agez Date: Sat, 11 Jul 2020 17:45:52 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8:=20add=20timer=20reset=20on=20touch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Battleground/Objective.vue | 24 +++++++++++++++++++++-- src/components/Battleground/Timer.vue | 12 +++++++++--- src/main.js | 2 +- 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/src/components/Battleground/Objective.vue b/src/components/Battleground/Objective.vue index 277bda9..3409e9c 100644 --- a/src/components/Battleground/Objective.vue +++ b/src/components/Battleground/Objective.vue @@ -1,12 +1,20 @@ @@ -28,6 +36,18 @@ } }, methods: { + clearObjective: function () { + if (this.$refs.timer.currentTime === 0) { + this.resetTimer() + } + }, + forceClearObjective: function () { + this.resetTimer() + }, + resetTimer: function () { + this.$refs.timer.setTime(this.objective.respawnTime) + this.$refs.timer.startTimer() + } }, components: { Timer diff --git a/src/components/Battleground/Timer.vue b/src/components/Battleground/Timer.vue index 59193aa..b5c4334 100644 --- a/src/components/Battleground/Timer.vue +++ b/src/components/Battleground/Timer.vue @@ -5,16 +5,19 @@