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

View file

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