Remove UsernameFiltered and fix colored mentions

This commit is contained in:
Pavel Djundik 2019-11-23 19:16:29 +02:00
parent dca6543070
commit 9b9c547e8c
3 changed files with 4 additions and 42 deletions

View file

@ -26,12 +26,13 @@
:class="['user-mode', getModeClass(mode)]" :class="['user-mode', getModeClass(mode)]"
> >
<template v-if="userSearchInput.length > 0"> <template v-if="userSearchInput.length > 0">
<UsernameFiltered <Username
v-for="user in users" v-for="user in users"
:key="user.original.nick" :key="user.original.nick"
:on-hover="hoverUser" :on-hover="hoverUser"
:active="user.original === activeUser" :active="user.original === activeUser"
:user="user" :user="user.original"
v-html="user.original.mode + user.string"
/> />
</template> </template>
<template v-else> <template v-else>
@ -51,7 +52,6 @@
<script> <script>
import {filter as fuzzyFilter} from "fuzzy"; import {filter as fuzzyFilter} from "fuzzy";
import Username from "./Username.vue"; import Username from "./Username.vue";
import UsernameFiltered from "./UsernameFiltered.vue";
const modes = { const modes = {
"~": "owner", "~": "owner",
@ -67,7 +67,6 @@ export default {
name: "ChatUserList", name: "ChatUserList",
components: { components: {
Username, Username,
UsernameFiltered,
}, },
props: { props: {
channel: Object, channel: Object,

View file

@ -6,7 +6,7 @@
v-on="onHover ? {mouseover: hover} : {}" v-on="onHover ? {mouseover: hover} : {}"
@click.prevent="openContextMenu" @click.prevent="openContextMenu"
@contextmenu.prevent="openContextMenu" @contextmenu.prevent="openContextMenu"
>{{ user.mode }}{{ user.nick }}</span ><slot>{{ user.mode }}{{ user.nick }}</slot></span
> >
</template> </template>

View file

@ -1,37 +0,0 @@
<template>
<span
:class="['user', nickColor, {active: active}]"
:data-name="user.original.nick"
role="button"
@mouseover="onHover(user.original)"
@click.prevent="openContextMenu"
@contextmenu.prevent="openContextMenu"
v-html="user.original.mode + user.string"
/>
</template>
<script>
import colorClass from "../js/helpers/colorClass";
export default {
name: "UsernameFiltered",
props: {
user: Object,
active: Boolean,
onHover: Function,
},
computed: {
nickColor() {
return colorClass(this.user.original.nick);
},
},
methods: {
openContextMenu(event) {
this.$root.$emit("contextmenu:user", {
event: event,
user: this.user.original,
});
},
},
};
</script>