2021-08-18 13:50:24 +02:00
|
|
|
<template>
|
|
|
|
<div class="w-full h-10 relative">
|
2021-08-20 00:29:36 +02:00
|
|
|
<div id="toolbar" class="absolute top-0 left-0 w-full h-full z-20 flex items-center px-8">
|
2021-08-19 03:18:44 +02:00
|
|
|
<p class="font-book">{{ numShowing }} Audiobooks</p>
|
|
|
|
<div class="flex-grow" />
|
2021-08-20 00:29:36 +02:00
|
|
|
<controls-filter-select v-model="settings.filterBy" class="w-40 h-7.5" @change="updateFilter" />
|
2021-08-19 03:18:44 +02:00
|
|
|
<span class="px-4 text-sm">by</span>
|
|
|
|
<controls-order-select v-model="settings.orderBy" :descending.sync="settings.orderDesc" class="w-40 h-7.5" @change="updateOrder" />
|
2021-08-18 13:50:24 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
data() {
|
2021-08-19 03:18:44 +02:00
|
|
|
return {
|
|
|
|
settings: {}
|
|
|
|
}
|
2021-08-18 13:50:24 +02:00
|
|
|
},
|
|
|
|
computed: {
|
2021-08-19 03:18:44 +02:00
|
|
|
numShowing() {
|
|
|
|
return this.$store.getters['audiobooks/getFiltered']().length
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
updateOrder() {
|
|
|
|
this.saveSettings()
|
|
|
|
},
|
|
|
|
updateFilter() {
|
|
|
|
this.saveSettings()
|
|
|
|
},
|
|
|
|
saveSettings() {
|
|
|
|
// Send to server
|
|
|
|
this.$store.commit('settings/setSettings', this.settings)
|
2021-08-18 13:50:24 +02:00
|
|
|
},
|
2021-08-19 03:18:44 +02:00
|
|
|
init() {
|
|
|
|
this.settings = { ...this.$store.state.settings.settings }
|
2021-08-18 13:50:24 +02:00
|
|
|
}
|
|
|
|
},
|
2021-08-19 03:18:44 +02:00
|
|
|
mounted() {
|
|
|
|
this.init()
|
|
|
|
}
|
2021-08-18 13:50:24 +02:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
#toolbar {
|
|
|
|
box-shadow: 0px 8px 8px #111111aa;
|
|
|
|
}
|
|
|
|
</style>
|