Add:Lazy bookshelf

This commit is contained in:
advplyr
2021-12-04 19:56:29 -06:00
parent 446c6756ed
commit 37d3021302
43 changed files with 2264 additions and 666 deletions
-2
View File
@@ -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>
+1 -2
View File
@@ -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) {
+1 -4
View File
@@ -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) {
+30 -1
View File
@@ -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() {},