Comment download

Former-commit-id: f1c430bf94bbf67ee3fe42c15df9805e8d7f3eb3 [formerly f4e34a00f33e607bcd7b752f8eec1bb6e79678cc] [formerly 8ba9cd9133ef9a566d691704a6ebe03c3c56cd72 [formerly 063cd4f5ed]]
Former-commit-id: 0b036c023d5f9929c34cb4be078bb493dd476547 [formerly 909ba7a88cbd83b9bd0be5c0813f2c5a91bcf62d]
Former-commit-id: add67bf286544c7c7d60d63861b05df82efa073f
pull/726/head
Henrique Dias 2017-07-08 11:15:23 +01:00
parent 60718b0eef
commit 946ce2df5a
1 changed files with 4 additions and 0 deletions

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')
} }
} }