PLT-6705 Show partially hidden channels as 'Unread above/below' (#6580)
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
46fc47e520
Коммит
3dc625a8bd
@@ -249,10 +249,13 @@ export default class Sidebar extends React.Component {
|
|||||||
var showTopUnread = false;
|
var showTopUnread = false;
|
||||||
var showBottomUnread = false;
|
var showBottomUnread = false;
|
||||||
|
|
||||||
|
// Consider partially obscured channels as above/below
|
||||||
|
const unreadMargin = 15;
|
||||||
|
|
||||||
if (this.firstUnreadChannel) {
|
if (this.firstUnreadChannel) {
|
||||||
var firstUnreadElement = $(ReactDOM.findDOMNode(this.refs[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;
|
showTopUnread = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -260,7 +263,7 @@ export default class Sidebar extends React.Component {
|
|||||||
if (this.lastUnreadChannel) {
|
if (this.lastUnreadChannel) {
|
||||||
var lastUnreadElement = $(ReactDOM.findDOMNode(this.refs[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;
|
showBottomUnread = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user