Commit de76e2e4 authored by Harrison Healey's avatar Harrison Healey Committed by Joram Wilander

PLT-6705 Show partially hidden channels as 'Unread above/below' (#6580)

parent e0b9f26b
......@@ -249,10 +249,13 @@ export default class Sidebar extends React.Component {
var showTopUnread = false;
var showBottomUnread = false;
// Consider partially obscured channels as above/below
const unreadMargin = 15;
if (this.firstUnreadChannel) {
var firstUnreadElement = $(ReactDOM.findDOMNode(this.refs[this.firstUnreadChannel]));
if (firstUnreadElement.position().top + firstUnreadElement.height() < 0) {
if (firstUnreadElement.position().top + firstUnreadElement.height() < unreadMargin) {
showTopUnread = true;
}
}
......@@ -260,7 +263,7 @@ export default class Sidebar extends React.Component {
if (this.lastUnreadChannel) {
var lastUnreadElement = $(ReactDOM.findDOMNode(this.refs[this.lastUnreadChannel]));
if (lastUnreadElement.position().top > container.height()) {
if (lastUnreadElement.position().top > container.height() - unreadMargin) {
showBottomUnread = true;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment