Skip to content

Commit

Permalink
wip: positioning windows after closing
Browse files Browse the repository at this point in the history
  • Loading branch information
roncodes committed Apr 3, 2024
1 parent 27ea3e7 commit a27f5a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion addon/components/chat-window.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ export default class ChatWindowComponent extends Component {
const multiplier = this.chat.openChannels.length - 1;
const marginRight = (chatWindowWidth + 20) * multiplier;
chatWindowElement.style.marginRight = `${marginRight}px`;

// reposition when chat is closed
this.chat.on('chat.closed', () => {
this.positionWindow(chatWindowElement);
});
}

@action autoScrollMessagesWindow(messagesWindowContainerElement) {
Expand All @@ -43,7 +48,6 @@ export default class ChatWindowComponent extends Component {

getSenderFromParticipants(channel) {
const participants = channel.participants ?? [];
console.log('#participants', participants);
const sender = participants.find((chatParticipant) => {
return chatParticipant.user_uuid === this.currentUser.id;
});
Expand Down
2 changes: 1 addition & 1 deletion addon/components/layout/header.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<Layout::Header::LoadingIndicator />
<div id="view-header-actions"></div>
<div class="flex items-center justify-between">
<div class="flex-1 flex items-center pr-1 space-x-2">
<div class="flex-1 flex items-center pr-1 space-x-1">
<LocaleSelectorTray />
<NotificationTray @registerAPI={{@registerNotificationTrayApi}} @onClickNotification={{@onClickNotification}} />
<ChatTray />
Expand Down

0 comments on commit a27f5a1

Please sign in to comment.