chore: share view logic responsability

This commit is contained in:
Ramires Viana
2021-03-03 17:46:37 +00:00
parent d8306559fd
commit edb9e85efd
12 changed files with 113 additions and 80 deletions

View File

@@ -158,7 +158,8 @@ export default {
'selected',
'user',
'show',
'multiple'
'multiple',
'selected'
]),
...mapGetters([
'selectedCount'
@@ -580,7 +581,20 @@ export default {
return
}
this.$store.commit('showHover', 'download')
this.$store.commit('showHover', {
prompt: 'download',
confirm: (format) => {
this.$store.commit('closeHovers')
let files = []
for (let i of this.selected) {
files.push(this.req.items[i].url)
}
api.download(format, ...files)
}
})
},
switchView: async function () {
this.$store.commit('closeHovers')