From 58598bfcf283c24354f45c7a45a7857171193225 Mon Sep 17 00:00:00 2001 From: advplyr Date: Sun, 18 Feb 2024 11:32:24 -0600 Subject: [PATCH] Update:Clamp author description to 4 lines and add more button #2614 --- client/pages/author/_id.vue | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/client/pages/author/_id.vue b/client/pages/author/_id.vue index 5ef1bef2..4e72f061 100644 --- a/client/pages/author/_id.vue +++ b/client/pages/author/_id.vue @@ -17,7 +17,10 @@

{{ $strings.LabelDescription }}

-

{{ author.description }}

+

{{ author.description }}

+ @@ -62,7 +65,10 @@ export default { } }, data() { - return {} + return { + isDescriptionClamped: false, + showFullDescription: false + } }, computed: { streamLibraryItem() { @@ -82,6 +88,10 @@ export default { } }, methods: { + checkDescriptionClamped() { + if (!this.$refs.description) return + this.isDescriptionClamped = this.$refs.description.scrollHeight > this.$refs.description.clientHeight + }, editAuthor() { this.$store.commit('globals/showEditAuthorModal', this.author) }, @@ -93,6 +103,7 @@ export default { series: this.authorSeries, libraryItems: this.libraryItems } + this.$nextTick(this.checkDescriptionClamped) } }, authorRemoved(author) { @@ -104,6 +115,7 @@ export default { }, mounted() { if (!this.author) this.$router.replace('/') + this.checkDescriptionClamped() this.$root.socket.on('author_updated', this.authorUpdated) this.$root.socket.on('author_removed', this.authorRemoved) @@ -113,4 +125,19 @@ export default { this.$root.socket.off('author_removed', this.authorRemoved) } } - \ No newline at end of file + + + \ No newline at end of file