From 24abacd4be3873479d815f23879d8240a316c142 Mon Sep 17 00:00:00 2001 From: vyneer Date: Fri, 15 Nov 2024 16:35:42 +0300 Subject: [PATCH 1/3] chore: remove comments leftover from the initial pr --- assets/chat/js/event-bar/EventBar.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/assets/chat/js/event-bar/EventBar.js b/assets/chat/js/event-bar/EventBar.js index 3755c12a..3cc3e9c4 100644 --- a/assets/chat/js/event-bar/EventBar.js +++ b/assets/chat/js/event-bar/EventBar.js @@ -59,9 +59,6 @@ export default class ChatEventBar extends EventEmitter { this.eventBarUI.prepend(event.element); - // // Update chat window to fix the scroll position - // this.chat.mainwindow.update(); - // event.startExpiry(); } From ee15bf0d0cfac1db0eabdc4f2eba33e1f0778937 Mon Sep 17 00:00:00 2001 From: vyneer Date: Fri, 15 Nov 2024 16:52:03 +0300 Subject: [PATCH 2/3] feat: dismiss event by clicking it again --- assets/chat/js/event-bar/EventBar.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/assets/chat/js/event-bar/EventBar.js b/assets/chat/js/event-bar/EventBar.js index 3cc3e9c4..e153c38d 100644 --- a/assets/chat/js/event-bar/EventBar.js +++ b/assets/chat/js/event-bar/EventBar.js @@ -49,6 +49,13 @@ export default class ChatEventBar extends EventEmitter { this.events.push(event); event.element.addEventListener('click', () => { + if ( + this.eventSelectUI.querySelector(`[data-uuid='${event.data.uuid}']`) + ) { + this.unselect(); + return; + } + this.select(event.selectedElement); }); event.on('eventExpired', this.removeEvent.bind(this)); From 8da4c7dc66cfc2443eef77e7921198f79bd4e3ee Mon Sep 17 00:00:00 2001 From: Farhad Jay Date: Sat, 16 Nov 2024 14:59:43 -0800 Subject: [PATCH 3/3] Prevent selection of username in event bar event This can occur when quickly opening and dismissing an event. Selection is undesirable for some UI elements. --- assets/chat/css/chat/event-bar/_event-bar-event.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/assets/chat/css/chat/event-bar/_event-bar-event.scss b/assets/chat/css/chat/event-bar/_event-bar-event.scss index 37bb53f2..bf38cb97 100644 --- a/assets/chat/css/chat/event-bar/_event-bar-event.scss +++ b/assets/chat/css/chat/event-bar/_event-bar-event.scss @@ -12,6 +12,7 @@ border-color: unset; border-width: 2px; margin: a.$gutter-sm; + user-select: none; .event-contents { display: flex;