Touch evt to listingitem

This commit is contained in:
Henrique Dias 2017-07-08 21:46:00 +01:00
parent 05884fd12d
commit 8a8ddbec20
No known key found for this signature in database
GPG Key ID: 936F5EB68D786730

View File

@ -6,6 +6,7 @@
@drop="drop"
@click="click"
@dblclick="open"
@touchstart="touchstart"
:aria-selected="isSelected">
<div>
<i class="material-icons">{{ icon }}</i>
@ -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})
}