diff options
| author | Henry Jameson <me@hjkos.com> | 2022-09-20 00:24:08 +0300 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2022-09-20 00:24:08 +0300 |
| commit | fa1d9f3fb4a886cde2553739f5f9a83aa35f2fdd (patch) | |
| tree | 0ea0a8d87ce26c0f56ff119dc836258a87889587 /src/components/update_notification/update_notification.js | |
| parent | d8730cad602fe5ba7faf7cefc4a1a67cd0896d9d (diff) | |
using the half-shit approach since proper approach is full-shit
Diffstat (limited to 'src/components/update_notification/update_notification.js')
| -rw-r--r-- | src/components/update_notification/update_notification.js | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/components/update_notification/update_notification.js b/src/components/update_notification/update_notification.js index 06241688..ddf379f5 100644 --- a/src/components/update_notification/update_notification.js +++ b/src/components/update_notification/update_notification.js @@ -17,9 +17,9 @@ export const CURRENT_UPDATE_COUNTER = 1 const UpdateNotification = { data () { return { + showingImage: false, pleromaTanVariant: Math.random() > 0.5 ? pleromaTan : pleromaTanFox, - showingMore: false, - contentHeight: 0 + showingMore: false } }, components: { @@ -32,11 +32,6 @@ const UpdateNotification = { 'shape-outside': 'url(' + mask + ')' } }, - dynamicStyles () { - return { - '--____extraInfoGroupHeight': this.contentHeight + 'px' - } - }, shouldShow () { return !this.$store.state.instance.disableUpdateNotification && this.$store.state.users.currentUser && @@ -60,12 +55,12 @@ const UpdateNotification = { } }, mounted () { + this.contentHeightNoImage = this.$refs.animatedText.scrollHeight + // Workaround to get the text height only after mask loaded. A bit hacky. const newImg = new Image() newImg.onload = () => { - setTimeout(() => { - this.contentHeight = this.$refs.animatedText.scrollHeight - }, 100) + setTimeout(() => { this.showingImage = true }, 100) } newImg.src = this.pleromaTanVariant === pleromaTan ? pleromaTanMask : pleromaTanFoxMask } |
