Comment download

This commit is contained in:
Henrique Dias 2017-07-08 11:15:23 +01:00
parent 32e66bb9c6
commit 063cd4f5ed
No known key found for this signature in database
GPG Key ID: 936F5EB68D786730

View File

@ -18,16 +18,20 @@ export default {
}, },
methods: { methods: {
download: function (event) { download: function (event) {
// If we are not on a listing, download the current file.
if (this.req.kind !== 'listing') { if (this.req.kind !== 'listing') {
api.download(null, this.$route.path) api.download(null, this.$route.path)
return return
} }
// If we are on a listing and there is one element selected,
// download it.
if (this.selectedCount === 1) { if (this.selectedCount === 1) {
api.download(null, this.req.items[this.selected[0]].url) api.download(null, this.req.items[this.selected[0]].url)
return return
} }
// Otherwise show the prompt to choose the formt of the download.
this.$store.commit('showHover', 'download') this.$store.commit('showHover', 'download')
} }
} }