diff --git a/client/components/app/Appbar.vue b/client/components/app/Appbar.vue index 70afc10a..ca21bba9 100644 --- a/client/components/app/Appbar.vue +++ b/client/components/app/Appbar.vue @@ -40,7 +40,7 @@

{{ numAudiobooksSelected }} Selected

{{ isAllSelected ? 'Select None' : 'Select All' }}({{ audiobooksShowing.length }}){{ isAllSelected ? 'Select None' : 'Select All' }}({{ totalBooks }})
@@ -65,7 +65,9 @@ export default { data() { return { - processingBatchDelete: false + processingBatchDelete: false, + totalBooks: 0, + isAllSelected: false } }, computed: { @@ -96,9 +98,9 @@ export default { selectedAudiobooks() { return this.$store.state.selectedAudiobooks }, - isAllSelected() { - return this.audiobooksShowing.length === this.selectedAudiobooks.length - }, + // isAllSelected() { + // return this.audiobooksShowing.length === this.selectedAudiobooks.length + // }, userAudiobooks() { return this.$store.state.user.user.audiobooks || {} }, @@ -145,13 +147,17 @@ export default { cancelSelectionMode() { if (this.processingBatchDelete) return this.$store.commit('setSelectedAudiobooks', []) + this.$eventBus.$emit('bookshelf-clear-selection') + this.isAllSelected = false }, toggleSelectAll() { if (this.isAllSelected) { this.cancelSelectionMode() } else { - var audiobookIds = this.audiobooksShowing.map((a) => a.id) - this.$store.commit('setSelectedAudiobooks', audiobookIds) + this.$eventBus.$emit('bookshelf-select-all') + this.isAllSelected = true + // var audiobookIds = this.audiobooksShowing.map((a) => a.id) + // this.$store.commit('setSelectedAudiobooks', audiobookIds) } }, toggleBatchRead() { @@ -205,9 +211,17 @@ export default { }, batchAddToCollectionClick() { this.$store.commit('globals/setShowBatchUserCollectionsModal', true) + }, + setBookshelfTotalBooks(totalBooks) { + this.totalBooks = totalBooks } }, - mounted() {} + mounted() { + this.$eventBus.$on('bookshelf-total-books', this.setBookshelfTotalBooks) + }, + beforeDestroy() { + this.$eventBus.$off('bookshelf-total-books', this.setBookshelfTotalBooks) + } } diff --git a/client/components/app/BookShelfCategorized.vue b/client/components/app/BookShelfCategorized.vue index dbddc742..7d7def7f 100644 --- a/client/components/app/BookShelfCategorized.vue +++ b/client/components/app/BookShelfCategorized.vue @@ -13,7 +13,7 @@

Texture

-
+

Your Audiobookshelf is empty!

Configure Scanner @@ -30,89 +30,36 @@ diff --git a/client/components/app/LazyBookshelf.vue b/client/components/app/LazyBookshelf.vue index 5a2f0b76..10b96db8 100644 --- a/client/components/app/LazyBookshelf.vue +++ b/client/components/app/LazyBookshelf.vue @@ -2,47 +2,77 @@
+ +
+

{{ emptyMessage }}

+
diff --git a/client/components/cards/BookCard.vue b/client/components/cards/BookCard.vue index 9f944562..5eb7d2b8 100644 --- a/client/components/cards/BookCard.vue +++ b/client/components/cards/BookCard.vue @@ -22,7 +22,7 @@ -