Files
wolk/_assets/src/components/DownloadButton.vue
Henrique Dias effa906f7c start editor
Former-commit-id: 7e783c70c379de0ae358ef3d887f0ebeb7926f57 [formerly abd06579471497ba043468705153bbb3eddc0a2d] [formerly 25b070c4daaa985ff8ce4a088f0bd61e56e98df8 [formerly 289171c092f335c78f860a35f3588102052a465e]]
Former-commit-id: ad79c60db1adb2008c47f66bf6ca9633243352e1 [formerly b121cb669150710898110d5a726ff7b6e3319d37]
Former-commit-id: b0f3fb734f550b7e6a6f46a40548ea40ecff614d
2017-06-29 21:46:08 +01:00

40 lines
1.4 KiB
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="count() > 0" class="counter">{{ count() }}</span>
</button>
</template>
<script>
var $ = window.info
export default {
name: 'download-button',
methods: {
count: function () {
return $.selected.length
},
download: function (event) {
if ($.req.kind !== 'listing') {
window.location = window.location.pathname + '?download=true'
return
}
/*
<ul class="dropdown" id="download-drop">
<a tabindex="0" aria-label="Download as Zip" data-format="zip" href="?download=zip"><li>zip</li></a>
<a tabindex="0" aria-label="Download as Tar" data-format="tar" href="?download=tar"><li>tar</li></a>
<a tabindex="0" aria-label="Download as TarGz" data-format="targz" href="?download=targz"><li>tar.gz</li></a>
<a tabindex="0" aria-label="Download as TarBz2" data-format="tarbz2" href="?download=tarbz2"><li>tar.bz2</li></a>
<a tabindex="0" aria-label="Download as TarXz" data-format="tarbz2" href="?download=tarxz"><li>tar.xz</li></a>
</ul>
*/
// document.getElementById('upload-input').click()
// TODO
alert('Not Implemented!')
}
}
}
</script>