Skip to content

Commit

Permalink
[NEW] Make the header for rooms clickable (#16762)
Browse files Browse the repository at this point in the history
  • Loading branch information
aKn1ghtOut authored Apr 20, 2020
1 parent e999580 commit bdc6107
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/theme/client/imports/components/header.css
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@

padding: 0 0.5rem;

cursor: pointer;

align-items: center;

&-action {
Expand Down
25 changes: 25 additions & 0 deletions app/ui/client/components/header/headerRoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,31 @@ Template.headerRoom.events({
});
}
},
'click .rc-header__content.rc-header__block'(event, instance) {
const { tabBar } = instance.parentTemplate();
const $flexTab = $('.flex-tab-container .flex-tab');

if (tabBar.getState() === 'opened' && (tabBar.getTemplate() === 'channelSettings' || tabBar.getTemplate() === 'membersList')) {
$flexTab.attr('template', '');
return tabBar.close();
}

if (instance.currentChannel.t !== 'd') {
$flexTab.attr('template', 'channelSettings');
tabBar.setData({
label: 'Room_Info',
icon: 'info-circled',
});
tabBar.open(TabBar.getButton('channel-settings'));
} else {
$flexTab.attr('template', 'membersList');
tabBar.setData({
label: 'User_Info',
icon: 'info-user',
});
tabBar.open(TabBar.getButton('user-info'));
}
},
});

const loadUserStatusText = () => {
Expand Down

0 comments on commit bdc6107

Please sign in to comment.