Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NEW] Make the header for rooms clickable #16762

Merged
merged 6 commits into from
Apr 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -177,6 +177,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', '');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this right setting the html property manually?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's been done the same way in flexTabBar.js. I think he got the snippet from there actually.

Copy link
Contributor Author

@aKn1ghtOut aKn1ghtOut Apr 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's accurate. I was looking for how it had been implemented, and that's the file I got to.

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