From ba7e71a7c3b0cc71012e5adf94b1c642e554972e Mon Sep 17 00:00:00 2001 From: Ramires Viana <59319979+ramiresviana@users.noreply.github.com> Date: Wed, 14 Apr 2021 15:29:06 +0000 Subject: [PATCH] fix: inconsistent double click on listing item --- frontend/src/components/files/ListingItem.vue | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/frontend/src/components/files/ListingItem.vue b/frontend/src/components/files/ListingItem.vue index 4e1a9383..83922030 100644 --- a/frontend/src/components/files/ListingItem.vue +++ b/frontend/src/components/files/ListingItem.vue @@ -8,8 +8,6 @@ @dragover="dragOver" @drop="drop" @click="itemClick" - @dblclick="dblclick" - @touchstart="touchstart" :data-dir="isDir" :aria-label="name" :aria-selected="isSelected" @@ -200,6 +198,16 @@ export default { }, click: function (event) { if (!this.singleClick && this.selectedCount !== 0) event.preventDefault(); + + setTimeout(() => { + this.touches = 0; + }, 300); + + this.touches++; + if (this.touches > 1) { + this.open(); + } + if (this.$store.state.selected.indexOf(this.index) !== -1) { this.removeSelected(this.index); return; @@ -235,19 +243,6 @@ export default { this.resetSelected(); this.addSelected(this.index); }, - dblclick: function () { - if (!this.singleClick) this.open(); - }, - touchstart() { - setTimeout(() => { - this.touches = 0; - }, 300); - - this.touches++; - if (this.touches > 1) { - this.open(); - } - }, open: function () { this.$router.push({ path: this.url }); },