mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2026-08-06 20:08:48 +02:00
Add:Lazy bookshelf
This commit is contained in:
@@ -22,8 +22,6 @@
|
||||
|
||||
<!-- <span class="material-icons cursor-pointer mx-4" :class="hasDownloadsFolder ? '' : 'text-warning'" @click="$store.commit('downloads/setShowModal', true)">source</span> -->
|
||||
|
||||
<!-- <widgets-connection-icon /> -->
|
||||
|
||||
<nuxt-link class="h-7 mx-2" to="/search">
|
||||
<span class="material-icons" style="font-size: 1.75rem">search</span>
|
||||
</nuxt-link>
|
||||
|
||||
@@ -54,7 +54,7 @@ export default {
|
||||
var booksPerShelf = Math.floor(this.pageWidth / (this.cardWidth + 32))
|
||||
var groupedBooks = []
|
||||
|
||||
var audiobooksSorted = this.$store.getters['audiobooks/getFilteredAndSorted']()
|
||||
var audiobooksSorted = []
|
||||
this.currFilterOrderKey = this.filterOrderKey
|
||||
|
||||
var numGroups = Math.ceil(audiobooksSorted.length / booksPerShelf)
|
||||
@@ -86,7 +86,6 @@ export default {
|
||||
if (currentLibrary) {
|
||||
this.$store.commit('libraries/setCurrentLibrary', currentLibrary.id)
|
||||
}
|
||||
this.$store.dispatch('audiobooks/load')
|
||||
},
|
||||
socketConnected(isConnected) {
|
||||
if (isConnected) {
|
||||
|
||||
@@ -51,9 +51,7 @@ export default {
|
||||
mobileFilterBy: 'all'
|
||||
})
|
||||
},
|
||||
calcShelves() {
|
||||
this.audiobooks = this.$store.getters['audiobooks/getFilteredAndSorted']()
|
||||
},
|
||||
calcShelves() {},
|
||||
audiobooksUpdated() {
|
||||
this.calcShelves()
|
||||
},
|
||||
@@ -76,7 +74,6 @@ export default {
|
||||
if (currentLibrary) {
|
||||
this.$store.commit('libraries/setCurrentLibrary', currentLibrary.id)
|
||||
}
|
||||
this.$store.dispatch('audiobooks/load')
|
||||
},
|
||||
socketConnected(isConnected) {
|
||||
if (isConnected) {
|
||||
|
||||
@@ -28,15 +28,25 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import TouchEvent from '@/objects/TouchEvent'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {}
|
||||
return {
|
||||
touchEvent: null
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
$route: {
|
||||
handler() {
|
||||
this.show = false
|
||||
}
|
||||
},
|
||||
show: {
|
||||
handler(newVal) {
|
||||
if (newVal) this.registerListener()
|
||||
else this.removeListener()
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -106,6 +116,25 @@ export default {
|
||||
|
||||
this.$store.commit('audiobooks/reset')
|
||||
this.$store.dispatch('audiobooks/useDownloaded')
|
||||
},
|
||||
touchstart(e) {
|
||||
this.touchEvent = new TouchEvent(e)
|
||||
},
|
||||
touchend(e) {
|
||||
if (!this.touchEvent) return
|
||||
this.touchEvent.setEndEvent(e)
|
||||
if (this.touchEvent.isSwipeRight()) {
|
||||
this.show = false
|
||||
}
|
||||
this.touchEvent = null
|
||||
},
|
||||
registerListener() {
|
||||
document.addEventListener('touchstart', this.touchstart)
|
||||
document.addEventListener('touchend', this.touchend)
|
||||
},
|
||||
removeListener() {
|
||||
document.removeEventListener('touchstart', this.touchstart)
|
||||
document.removeEventListener('touchend', this.touchend)
|
||||
}
|
||||
},
|
||||
mounted() {},
|
||||
|
||||
Reference in New Issue
Block a user