From d903c9333fe0ed8e7bda0ec14ac11d0b3a05fb38 Mon Sep 17 00:00:00 2001 From: jgerstbe Date: Fri, 17 Jul 2020 11:23:39 +0200 Subject: [PATCH] [U] fix timeout behaviour on prev/next+pause --- public/app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/app.js b/public/app.js index bf202e1..9c67d2c 100644 --- a/public/app.js +++ b/public/app.js @@ -11,7 +11,7 @@ new Vue({ next: function () { this.carouselActive = true; clearTimeout(this.timeout); - setTimeout(() => this.carousel(), this.carouselTimeout*2); + this.timeout = setTimeout(() => this.carousel(), this.carouselTimeout*2); if (this.index + 1 < this.files.length) { this.index++; } else { @@ -21,7 +21,7 @@ new Vue({ prev: function () { this.carouselActive = true; clearTimeout(this.timeout); - setTimeout(() => this.carousel(), this.carouselTimeout*2); + this.timeout = setTimeout(() => this.carousel(), this.carouselTimeout*2); if (this.index - 1 >= 0) { this.index--; } else { @@ -43,9 +43,9 @@ new Vue({ ) }, toggleCarousel: function () { + clearTimeout(this.timeout); if (this.carouselActive) { this.carouselActive = false; - clearTimeout(this.timeout); } else { this.carouselActive = true; this.carousel();