Henrique Dias bae3c341f6 Organisation and reworking stuff
Former-commit-id: 01621444e51316cc9f125e4d541caf9d6c9d37a1 [formerly 733a976b594348754cb34b27c594c485fd5b0df4] [formerly 36a2f39b0e471ee231343ebaed474ae247764b37 [formerly 8d891f0d513d21282adfd9e1b9f206b69f4b17c7]]
Former-commit-id: 505c381e3135c0e0607e984a37e908672e8100a3 [formerly a6e70288608c6ee1edc380af76ee3e82ff62861a]
Former-commit-id: d946069b4f8ad1b19da7ee087901762b3f4b7936
2017-07-03 11:20:36 +01:00

30 lines
694 B
Vue

<template>
<button @click="download" aria-label="Download" title="Download" class="action">
<i class="material-icons">file_download</i>
<span>Download</span>
<span v-if="selectedCount > 0" class="counter">{{ selectedCount }}</span>
</button>
</template>
<script>
import {mapGetters, mapState} from 'vuex'
export default {
name: 'download-button',
computed: {
...mapState(['req']),
...mapGetters(['selectedCount'])
},
methods: {
download: function (event) {
if (this.req.kind !== 'listing') {
window.open(`${window.location.pathname}?download=true`)
return
}
this.$store.commit('showDownload', true)
}
}
}
</script>