From 946ce2df5ab5a72b83874489de54b6fcf8481b08 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Sat, 8 Jul 2017 11:15:23 +0100 Subject: [PATCH] Comment download Former-commit-id: f1c430bf94bbf67ee3fe42c15df9805e8d7f3eb3 [formerly f4e34a00f33e607bcd7b752f8eec1bb6e79678cc] [formerly 8ba9cd9133ef9a566d691704a6ebe03c3c56cd72 [formerly 063cd4f5ed4d8498b2899e35af45aff07b7775d1]] Former-commit-id: 0b036c023d5f9929c34cb4be078bb493dd476547 [formerly 909ba7a88cbd83b9bd0be5c0813f2c5a91bcf62d] Former-commit-id: add67bf286544c7c7d60d63861b05df82efa073f --- assets/src/components/buttons/Download.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/assets/src/components/buttons/Download.vue b/assets/src/components/buttons/Download.vue index d1534be4..b356f97e 100644 --- a/assets/src/components/buttons/Download.vue +++ b/assets/src/components/buttons/Download.vue @@ -18,16 +18,20 @@ export default { }, methods: { download: function (event) { + // If we are not on a listing, download the current file. if (this.req.kind !== 'listing') { api.download(null, this.$route.path) return } + // If we are on a listing and there is one element selected, + // download it. if (this.selectedCount === 1) { api.download(null, this.req.items[this.selected[0]].url) return } + // Otherwise show the prompt to choose the formt of the download. this.$store.commit('showHover', 'download') } }