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

[FIX] fix color on unread messages #8282

Merged
merged 1 commit into from
Sep 25, 2017
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
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,6 @@
}
}

&--darken {
&:hover {
background-color: var(--sidebar-item-darken-hover-background);
}

& .sidebar-item__link {
color: var(--sidebar-item-darken-text-color);
}
}

&--lighten:hover {
background-color: var(--sidebar-item-lighten-hover-background);
}

&__popup-active {
background-color: var(--sidebar-item-popup-background);
}
Expand Down
6 changes: 1 addition & 5 deletions packages/rocketchat-ui-sidenav/client/chatRoomItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ Template.chatRoomItem.helpers({

const archivedClass = this.archived ? 'archived' : false;

let alertClass = false;
if (!this.hideUnreadStatus && (FlowRouter.getParam('_id') !== this.rid || !document.hasFocus()) && this.alert) {
alertClass = 'sidebar-item__link--active';
}
this.alert = !this.hideUnreadStatus && (FlowRouter.getParam('_id') !== this.rid || !document.hasFocus()) && this.alert;

const icon = RocketChat.roomTypes.getIcon(this.t);
const avatar = !icon;
Expand All @@ -37,7 +34,6 @@ Template.chatRoomItem.helpers({
unread,
active,
archivedClass,
alertClass,
statusClass: this.t === 'd' ? Session.get(`user_${ this.name }_status`) || 'offline' : this.t === 'l' ? RocketChat.roomTypes.getUserStatus(this.t, this.rid) || 'offline' : false
};
}
Expand Down
4 changes: 2 additions & 2 deletions packages/rocketchat-ui-sidenav/client/sidebarItem.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<template name="sidebarItem">
<li class="sidebar-item {{#if unread}}sidebar-item--unread{{/if}} {{#if active}}sidebar-item--active{{/if}} {{#if toolbar}}popup-item{{/if}}" data-id="{{_id}}">
<li class="sidebar-item {{#if or unread alert }}sidebar-item--unread{{/if}} {{#if active}}sidebar-item--active{{/if}} {{#if toolbar}}popup-item{{/if}}" data-id="{{_id}}">
{{#if statusClass}}
<div class="sidebar-item__user-status sidebar-item__user-status--{{statusClass}}"></div>
{{/if}}
<a class="sidebar-item__link {{alertClass}} {{#if active}}sidebar-item__link--active{{/if}}" href="{{#if route}}{{route}}{{else}}{{pathFor pathSection group=pathGroup}}{{/if}}" title="{{name}}">
<a class="sidebar-item__link" href="{{#if route}}{{route}}{{else}}{{pathFor pathSection group=pathGroup}}{{/if}}" title="{{name}}">
<div class="sidebar-item__picture">
{{#if icon}}
{{> icon block="sidebar-item__icon" icon=icon}}
Expand Down
6 changes: 6 additions & 0 deletions packages/rocketchat-ui-sidenav/client/sidebarItem.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
/* globals menu popover */
Template.sidebarItem.helpers({
or(...args) {
args.pop();
return args.some(arg => arg);
}
});
Template.sidebarItem.events({
'click [data-id], click .sidebar-item__link'() {
return menu.close();
Expand Down