Skip to content

Commit

Permalink
Merge pull request #559 from vyneer/feat/dismiss-selected-event
Browse files Browse the repository at this point in the history
Dismiss selected event by clicking it again
  • Loading branch information
11k authored Nov 16, 2024
2 parents 1ea42a5 + 8da4c7d commit 6a03937
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions assets/chat/css/chat/event-bar/_event-bar-event.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
border-color: unset;
border-width: 2px;
margin: a.$gutter-sm;
user-select: none;

.event-contents {
display: flex;
Expand Down
10 changes: 7 additions & 3 deletions assets/chat/js/event-bar/EventBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -59,9 +66,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();
}

Expand Down

0 comments on commit 6a03937

Please sign in to comment.