From 8a8ddbec20f92f0c576279de85dfe71e62855d81 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Sat, 8 Jul 2017 21:46:00 +0100 Subject: [PATCH] Touch evt to listingitem --- assets/src/components/ListingItem.vue | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/assets/src/components/ListingItem.vue b/assets/src/components/ListingItem.vue index 1af77e3f..52f05444 100644 --- a/assets/src/components/ListingItem.vue +++ b/assets/src/components/ListingItem.vue @@ -6,6 +6,7 @@ @drop="drop" @click="click" @dblclick="open" + @touchstart="touchstart" :aria-selected="isSelected">
{{ icon }} @@ -32,6 +33,11 @@ import api from '@/utils/api' export default { name: 'item', + data: function () { + return { + touches: 0 + } + }, props: ['name', 'isDir', 'url', 'type', 'size', 'modified', 'index'], computed: { ...mapState(['selected', 'req']), @@ -115,6 +121,16 @@ export default { return false }, + touchstart (event) { + setTimeout(() => { + this.touches = 0 + }, 300) + + this.touches++ + if (this.touches > 1) { + this.open() + } + }, open: function (event) { this.$router.push({path: this.url}) }