Skip to content

Commit

Permalink
Revert some changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Mitchdev committed Nov 24, 2024
1 parent ebbd3cf commit 2614819
Showing 1 changed file with 11 additions and 25 deletions.
36 changes: 11 additions & 25 deletions assets/chat/js/menus/ChatUserMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,6 @@ export default class ChatUserMenu extends ChatMenu {
true,
),
);
this.userActionsNode = this.createUserActionNode();
this.container.on('mouseenter', '.user-entry', (e) => {
e.currentTarget.appendChild(this.userActionsNode);
});
this.container.on('mouseleave', '.user-entry', (e) => {
e.currentTarget.removeChild(this.userActionsNode);
});
this.container.on('click', '.whisper-nick', (e) => {
ChatMenu.closeMenus(this.chat);
const value = this.chat.input.val().toString().trim();
Expand Down Expand Up @@ -93,23 +86,6 @@ export default class ChatUserMenu extends ChatMenu {
);
}

createUserActionNode() {
const userActions = document.createElement('div');
userActions.classList.add('user-actions');
const whisperButton = document.createElement('i');
whisperButton.classList.add('whisper-nick');
userActions.append(whisperButton);
tippy(whisperButton, {
content: 'Whisper',
arrow: roundArrow,
duration: 0,
maxWidth: 250,
hideOnClick: false,
theme: 'dgg',
});
return userActions;
}

show() {
super.show();
this.searchinput.focus();
Expand Down Expand Up @@ -260,8 +236,18 @@ export default class ChatUserMenu extends ChatMenu {
const features =
user.features.length === 0 ? 'nofeature' : user.features.join(' ');
const usr = $(
`<div class="user-entry" data-username="${user.username}" data-user-id="${user.id}"><span class="user ${features}">${label}</span></div>`,
`<div class="user-entry" data-username="${user.username}" data-user-id="${user.id}"><span class="user ${features}">${label}</span><div class="user-actions"><i class="whisper-nick" data-tippy-content="Whisper"></i></div></div>`,
);
usr.find('[data-tippy-content]').each(function registerTippy() {
tippy(this, {
content: this.getAttribute('data-tippy-content'),
arrow: roundArrow,
duration: 0,
maxWidth: 250,
hideOnClick: false,
theme: 'dgg',
});
});
const section = this.sections.get(this.highestSection(user));

if (sort && section.users.children.length > 0) {
Expand Down

0 comments on commit 2614819

Please sign in to comment.