Remove direct style manipulations in favor of classes

This commit is contained in:
eugenijm 2020-07-07 21:43:46 +03:00
parent ed7310c04b
commit fc865d3a12
5 changed files with 16 additions and 17 deletions

View File

@ -60,19 +60,6 @@ const ChatMessage = {
currentUser: state => state.users.currentUser, currentUser: state => state.users.currentUser,
restrictedNicknames: state => state.instance.restrictedNicknames restrictedNicknames: state => state.instance.restrictedNicknames
}), }),
ellipsisButtonWrapperStyle () {
let res = {
'opacity': this.hovered || this.menuOpened ? '1' : '0'
}
if (this.isCurrentUser) {
res.right = '0.4rem'
} else {
res.left = '0.4rem'
}
return res
},
popoverMarginStyle () { popoverMarginStyle () {
if (this.isCurrentUser) { if (this.isCurrentUser) {
return {} return {}

View File

@ -117,6 +117,10 @@
color: var(--chatMessageIncomingText, $fallback--text); color: var(--chatMessageIncomingText, $fallback--text);
} }
} }
.chat-message-menu {
left: 0.4rem;
}
} }
.outgoing { .outgoing {
@ -139,6 +143,14 @@
.chat-message-inner { .chat-message-inner {
align-items: flex-end; align-items: flex-end;
} }
.chat-message-menu {
right: 0.4rem;
}
}
.visible {
opacity: 1;
} }
} }

View File

@ -39,7 +39,7 @@
> >
<div <div
class="chat-message-menu" class="chat-message-menu"
:style="ellipsisButtonWrapperStyle" :class="{ 'visible': hovered || menuOpened }"
> >
<Popover <Popover
trigger="click" trigger="click"

View File

@ -31,8 +31,8 @@ const MobileNav = {
}, },
hideSitename () { return this.$store.state.instance.hideSitename }, hideSitename () { return this.$store.state.instance.hideSitename },
sitename () { return this.$store.state.instance.name }, sitename () { return this.$store.state.instance.name },
navBarStyle () { isChat () {
return { 'visibility': this.$route.name === 'chat' ? 'hidden' : 'visible' } return this.$route.name === 'chat'
} }
}, },
methods: { methods: {

View File

@ -3,7 +3,7 @@
<nav <nav
id="nav" id="nav"
class="nav-bar container" class="nav-bar container"
:style="navBarStyle" :class="{ 'mobile-hidden': isChat }"
> >
<div <div
class="mobile-inner-nav" class="mobile-inner-nav"