mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
top_left_corner: Directly use span.unread_count to display unreads.
In an effort to use a common class to display unread counts across the app, we simplify the elements used to show unreads and use a single `span` with `unread_count` class to do so.
This commit is contained in:
@@ -8,9 +8,9 @@ import * as pm_conversations from "./pm_conversations";
|
||||
import * as pm_list_dom from "./pm_list_dom";
|
||||
import * as stream_popover from "./stream_popover";
|
||||
import * as ui from "./ui";
|
||||
import * as ui_util from "./ui_util";
|
||||
import * as unread from "./unread";
|
||||
import * as vdom from "./vdom";
|
||||
import * as ui_util from "./ui_util";
|
||||
|
||||
let prior_dom;
|
||||
let private_messages_open = false;
|
||||
|
||||
@@ -3,8 +3,8 @@ import $ from "jquery";
|
||||
import * as people from "./people";
|
||||
import * as pm_list from "./pm_list";
|
||||
import * as resize from "./resize";
|
||||
import * as unread_ui from "./unread_ui";
|
||||
import * as ui_util from "./ui_util";
|
||||
import * as unread_ui from "./unread_ui";
|
||||
|
||||
export function update_starred_count(count) {
|
||||
const starred_li = $(".top_left_starred_messages");
|
||||
|
||||
@@ -42,15 +42,14 @@ export function convert_enter_to_click(e) {
|
||||
export function update_unread_count_in_dom(unread_count_elem, count) {
|
||||
// This function is used to update unread count in top left corner
|
||||
// elements.
|
||||
const count_span = unread_count_elem.find(".count");
|
||||
const value_span = count_span.find(".value");
|
||||
const unread_count_span = unread_count_elem.find(".unread_count");
|
||||
|
||||
if (count === 0) {
|
||||
count_span.hide();
|
||||
value_span.text("");
|
||||
unread_count_span.hide();
|
||||
unread_count_span.text("");
|
||||
return;
|
||||
}
|
||||
|
||||
count_span.show();
|
||||
value_span.text(count);
|
||||
unread_count_span.show();
|
||||
unread_count_span.text(count);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user