mirror of https://github.com/zulip/zulip.git
navbar: Simplify unread logic on left-sidebar toggle indicator.
This removes former animation logic as well as counts, as the redesign calls only for showing an unread dot in the presence of unreads. Fixes: #27357
This commit is contained in:
parent
8ee764382b
commit
105729ce66
|
@ -62,16 +62,9 @@ export function notify_messages_remain_unread() {
|
||||||
|
|
||||||
export function set_count_toggle_button($elem, count) {
|
export function set_count_toggle_button($elem, count) {
|
||||||
if (count === 0) {
|
if (count === 0) {
|
||||||
if ($elem.is(":animated")) {
|
return $elem.hide();
|
||||||
return $elem.stop(true, true).hide();
|
|
||||||
}
|
|
||||||
return $elem.hide(500);
|
|
||||||
} else if (count > 0 && count < 1000) {
|
|
||||||
$elem.show(500);
|
|
||||||
return $elem.text(count);
|
|
||||||
}
|
}
|
||||||
$elem.show(500);
|
return $elem.show();
|
||||||
return $elem.text("1k+");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function update_unread_counts(skip_animations = false) {
|
export function update_unread_counts(skip_animations = false) {
|
||||||
|
@ -86,8 +79,7 @@ export function update_unread_counts(skip_animations = false) {
|
||||||
hook(res, skip_animations);
|
hook(res, skip_animations);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the unread counts that we show in the buttons that
|
// Set the unread indicator on the toggle for the left sidebar
|
||||||
// toggle open the sidebar menus when we have a thin window.
|
|
||||||
set_count_toggle_button($("#streamlist-toggle-unreadcount"), res.home_unread_messages);
|
set_count_toggle_button($("#streamlist-toggle-unreadcount"), res.home_unread_messages);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue