left_sidebar: Use DM identifiers around direct-messages list.

This commit is contained in:
Karl Stolley
2023-10-30 10:18:29 -05:00
committed by Tim Abbott
parent dcd891a176
commit 825a7106c6
5 changed files with 8 additions and 8 deletions

View File

@@ -37,7 +37,7 @@ export function close() {
update_private_messages(); update_private_messages();
} }
export function _build_private_messages_list() { export function _build_direct_messages_list() {
const conversations = pm_list_data.get_conversations(); const conversations = pm_list_data.get_conversations();
const pm_list_info = pm_list_data.get_list_info(zoomed); const pm_list_info = pm_list_data.get_list_info(zoomed);
const conversations_to_be_shown = pm_list_info.conversations_to_be_shown; const conversations_to_be_shown = pm_list_info.conversations_to_be_shown;
@@ -58,7 +58,7 @@ export function _build_private_messages_list() {
} }
function set_dom_to(new_dom) { function set_dom_to(new_dom) {
const $container = scroll_util.get_content_element($("#private_messages_list")); const $container = scroll_util.get_content_element($("#direct-messages-list"));
function replace_content(html) { function replace_content(html) {
$container.html(html); $container.html(html);
@@ -90,7 +90,7 @@ export function update_private_messages() {
prior_dom = undefined; prior_dom = undefined;
} }
} else { } else {
const new_dom = _build_private_messages_list(); const new_dom = _build_direct_messages_list();
set_dom_to(new_dom); set_dom_to(new_dom);
} }
// Make sure to update the left sidebar heights after updating // Make sure to update the left sidebar heights after updating

View File

@@ -817,7 +817,7 @@ export function set_event_handlers({on_stream_click}) {
const scroll_position = $( const scroll_position = $(
"#left_sidebar_scroll_container .simplebar-content-wrapper", "#left_sidebar_scroll_container .simplebar-content-wrapper",
).scrollTop(); ).scrollTop();
const pm_list_height = $("#private_messages_list").height(); const pm_list_height = $("#direct-messages-list").height();
if (scroll_position > pm_list_height) { if (scroll_position > pm_list_height) {
$("#toggle_private_messages_section_icon").addClass("fa-caret-right"); $("#toggle_private_messages_section_icon").addClass("fa-caret-right");
$("#toggle_private_messages_section_icon").removeClass("fa-caret-down"); $("#toggle_private_messages_section_icon").removeClass("fa-caret-down");

View File

@@ -430,7 +430,7 @@
.active_private_messages_section { .active_private_messages_section {
#private_messages_section, #private_messages_section,
#private_messages_list, #direct-messages-list,
#hide-more-direct-messages { #hide-more-direct-messages {
background-color: hsl(199deg 33% 46% / 20%); background-color: hsl(199deg 33% 46% / 20%);
} }

View File

@@ -335,7 +335,7 @@ li.show-more-topics {
.active_private_messages_section { .active_private_messages_section {
#private_messages_section, #private_messages_section,
#private_messages_list, #direct-messages-list,
#hide-more-direct-messages { #hide-more-direct-messages {
background-color: hsl(202deg 56% 91%); background-color: hsl(202deg 56% 91%);
} }
@@ -344,7 +344,7 @@ li.show-more-topics {
border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0;
} }
#private_messages_list { #direct-messages-list {
border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px;
} }

View File

@@ -149,7 +149,7 @@
{{~!-- squash whitespace --~}} {{~!-- squash whitespace --~}}
<div id="left_sidebar_scroll_container" class="scrolling_list" data-simplebar> <div id="left_sidebar_scroll_container" class="scrolling_list" data-simplebar>
<div class="direct-messages-container zoom-out hidden-for-spectators"> <div class="direct-messages-container zoom-out hidden-for-spectators">
<div id="private_messages_list"></div> <div id="direct-messages-list"></div>
</div> </div>
<div id="streams_list" class="zoom-out"> <div id="streams_list" class="zoom-out">