Skip to content
Closed
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
4 changes: 4 additions & 0 deletions app/theme/client/imports/components/sidebar/sidebar-item.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
}
}

.selected-bg-shade {
background-color: var(--sidebar-background-light-active) !important;
}

.sidebar--hide-avatar .sidebar-item__picture {
display: none;
}
Expand Down
1 change: 1 addition & 0 deletions app/theme/client/imports/general/variables.css
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@
--sidebar-background-hover: var(--rc-color-primary-dark);
--sidebar-background-light: var(--rc-color-primary-lightest);
--sidebar-background-light-hover: var(--rc-color-primary-light);
--sidebar-background-light-active: var(--rc-color-primary-light);
--sidebar-default-padding: 24px;
--sidebar-small-default-padding: 16px;
--sidebar-extra-small-default-padding: 12px;
Expand Down
15 changes: 11 additions & 4 deletions app/ui-account/client/accountFlex.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,20 @@ import { t } from '../../utils';
Template.accountFlex.events({
'click [data-action="close"]'() {
SideNav.closeFlex();
const sidebarElements = document.getElementsByClassName('sidebar-item');
for (let i = 0; i < sidebarElements.length; i++) {
const nonSelectedElement = sidebarElements[i].getElementsByTagName('a')[0];
if (!sidebarElements[i].hasAttribute('data-id')) {
if (nonSelectedElement.getAttribute('aria-label') !== 'Preferences') {
sidebarElements[i].classList.remove('selected-bg-shade');
} else {
sidebarElements[i].classList.add('selected-bg-shade');
}
}
}
},
});

// Template.accountFlex.onRendered(function() {
// $(this.find('.rooms-list')).perfectScrollbar();
// });

Template.accountFlex.helpers({
allowUserProfileChange() {
return settings.get('Accounts_AllowUserProfileChange');
Expand Down
14 changes: 13 additions & 1 deletion app/ui-sidenav/client/sidebarItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,19 @@ Template.sidebarItem.onCreated(function() {
});

Template.sidebarItem.events({
'click [data-id], click .sidebar-item__link'() {
'click [data-id], click .sidebar-item__link'(e) {
const element = e.currentTarget;
const sidebarElements = document.getElementsByClassName('sidebar-item');
for (let i = 0; i < sidebarElements.length; i++) {
const nonSelectedElement = sidebarElements[i].getElementsByTagName('a')[0];
if (!sidebarElements[i].hasAttribute('data-id')) {
if (nonSelectedElement.getAttribute('aria-label') === element.getAttribute('aria-label')) {
sidebarElements[i].classList.add('selected-bg-shade');
} else {
sidebarElements[i].classList.remove('selected-bg-shade');
}
}
}
return menu.close();
},
'click .sidebar-item__menu'(e) {
Expand Down
51 changes: 43 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions private/client/imports/general/variables.css
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@
--sidebar-background-hover: var(--rc-color-primary-dark);
--sidebar-background-light: var(--rc-color-primary-lightest);
--sidebar-background-light-hover: var(--rc-color-primary-light);
--sidebar-background-light-active: var(--rc-color-primary-light);
--sidebar-default-padding: 24px;
--sidebar-small-default-padding: 16px;
--sidebar-extra-small-default-padding: 12px;
Expand Down