Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

left_sidebar: Remove unnecessary nested `#direct-messages-section`.

Shubham Padia737e075cc33d
diff --git a/web/src/pm_list.ts b/web/src/pm_list.ts
index af6ee19cd86..7466e1fabaa 100644
--- a/web/src/pm_list.ts
+++ b/web/src/pm_list.ts
@@ -23,7 +23,7 @@ let private_messages_collapsed = false;
let zoomed = false;
function get_private_messages_section_header(): JQuery {
- return $(".direct-messages-container #direct-messages-section #direct-messages-section-header");
+ return $(".direct-messages-container #direct-messages-section-header");
}
export function set_count(count: number): void {
diff --git a/web/styles/left_sidebar.css b/web/styles/left_sidebar.css
index 60b781f2a9d..2ea7ed26c41 100644
--- a/web/styles/left_sidebar.css
+++ b/web/styles/left_sidebar.css
@@ -313,7 +313,7 @@ li.show-more-topics {
.active-direct-messages-section {
background-color: var(--color-background-active-narrow-filter);
- #direct-messages-section {
+ #direct-messages-section-header {
border-radius: 4px 4px 0 0;
}
diff --git a/web/templates/left_sidebar.hbs b/web/templates/left_sidebar.hbs
index 0e6852de68f..5a4650db131 100644
--- a/web/templates/left_sidebar.hbs
+++ b/web/templates/left_sidebar.hbs
@@ -144,20 +144,18 @@
</div>
<div id="direct-messages-sticky-header" class="direct-messages-container zoom-out hidden-for-spectators">
- <div id="direct-messages-section">
- <div id="direct-messages-section-header" class="zoom-out zoom-in-sticky">
- <i id="toggle-direct-messages-section-icon" class="fa fa-sm fa-caret-down dm-tooltip-target zoom-in-hide" aria-hidden="true" tabindex="0" role="button"></i>
- <h4 class="left-sidebar-title"><span class="dm-tooltip-target">{{t 'DIRECT MESSAGES' }}</span></h4>
- <div class="heading-markers-and-controls">
- <a id="show-all-direct-messages" href="#narrow/is/dm" data-tooltip-template-id="show-all-direct-messages-template">
- <i class="fa fa-align-right" aria-label="{{t 'Direct message feed' }}"></i>
- </a>
- <span class="unread_count"></span>
- </div>
- <a class="zoom-out-hide" id="hide-more-direct-messages">
- <span class="hide-more-direct-messages-text"> {{t 'back to channels' }}</span>
+ <div id="direct-messages-section-header" class="zoom-out zoom-in-sticky">
+ <i id="toggle-direct-messages-section-icon" class="fa fa-sm fa-caret-down dm-tooltip-target zoom-in-hide" aria-hidden="true" tabindex="0" role="button"></i>
+ <h4 class="left-sidebar-title"><span class="dm-tooltip-target">{{t 'DIRECT MESSAGES' }}</span></h4>
+ <div class="heading-markers-and-controls">
+ <a id="show-all-direct-messages" href="#narrow/is/dm" data-tooltip-template-id="show-all-direct-messages-template">
+ <i class="fa fa-align-right" aria-label="{{t 'Direct message feed' }}"></i>
</a>
+ <span class="unread_count"></span>
</div>
+ <a class="zoom-out-hide" id="hide-more-direct-messages">
+ <span class="hide-more-direct-messages-text"> {{t 'back to channels' }}</span>
+ </a>
</div>
</div>
{{~!-- squash whitespace --~}}
diff --git a/web/tests/pm_list.test.js b/web/tests/pm_list.test.js
index 612dbcfcf9d..757abb0ca09 100644
--- a/web/tests/pm_list.test.js
+++ b/web/tests/pm_list.test.js
@@ -12,9 +12,7 @@ run_test("update_dom_with_unread_counts", () => {
let counts;
const $total_count = $.create("total-count-stub");
- const $private_li = $(
- ".direct-messages-container #direct-messages-section #direct-messages-section-header",
- );
+ const $private_li = $(".direct-messages-container #direct-messages-section-header");
$private_li.set_find_results(".unread_count", $total_count);
counts = {