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