Skip to content

Commit

Permalink
Merge pull request #8282 from RocketChat/hover-color
Browse files Browse the repository at this point in the history
fix color on unread messages
  • Loading branch information
rodrigok committed Sep 26, 2017
1 parent 9543632 commit cb8fa8f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 21 deletions.
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

0 comments on commit cb8fa8f

Please sign in to comment.