mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
buddy_list: Set html instead of append for view all subscribers link.
Earlier, we were appending view all subscribers link using JQuery.append, which leaves open the possibility for the component to be appended multiple times if the function calling it gets called multiple times. It is better to have the link div in right_sidebar.hbs and then insert the html when required.
This commit is contained in:
committed by
Tim Abbott
parent
90a1f0f7aa
commit
7b925ce94a
@@ -366,7 +366,7 @@ export class BuddyList extends BuddyListConf {
|
||||
this.fill_screen_with_content();
|
||||
|
||||
// This must happen after `fill_screen_with_content`
|
||||
$("#buddy-list-users-matching-view-container .view-all-subscribers-link").remove();
|
||||
$("#buddy-list-users-matching-view-container .view-all-subscribers-link").empty();
|
||||
$("#buddy-list-other-users-container .view-all-users-link").empty();
|
||||
void this.render_view_user_list_links();
|
||||
this.display_or_hide_sections();
|
||||
@@ -746,12 +746,10 @@ export class BuddyList extends BuddyListConf {
|
||||
current_sub,
|
||||
"subscribers",
|
||||
);
|
||||
$("#buddy-list-users-matching-view-container").append(
|
||||
$(
|
||||
$("#buddy-list-users-matching-view-container .view-all-subscribers-link").html(
|
||||
render_view_all_subscribers({
|
||||
stream_edit_hash,
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,5 @@
|
||||
<div class="buddy-list-user-link view-all-subscribers-link">
|
||||
<a class="right-sidebar-wrappable-text-container" href="{{stream_edit_hash}}">
|
||||
<a class="right-sidebar-wrappable-text-container" href="{{stream_edit_hash}}">
|
||||
<span class="right-sidebar-wrappable-text-inner">
|
||||
{{t "View all subscribers" }}
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</a>
|
||||
|
@@ -20,6 +20,7 @@
|
||||
<div id="buddy-list-users-matching-view-container" class="buddy-list-section-container">
|
||||
<div class="buddy-list-subsection-header"></div>
|
||||
<ul id="buddy-list-users-matching-view" class="buddy-list-section"></ul>
|
||||
<div class="buddy-list-user-link view-all-subscribers-link"></div>
|
||||
</div>
|
||||
<div id="buddy-list-other-users-container" class="buddy-list-section-container">
|
||||
<div class="buddy-list-subsection-header"></div>
|
||||
|
@@ -41,7 +41,7 @@ exports.stub_buddy_list_elements = () => {
|
||||
$("#buddy-list-users-matching-view .empty-list-message").length = 0;
|
||||
$("#buddy-list-other-users .empty-list-message").length = 0;
|
||||
$("#buddy-list-other-users-container .view-all-users-link").length = 0;
|
||||
$("#buddy-list-users-matching-view-container .view-all-subscribers-link").remove = noop;
|
||||
$("#buddy-list-users-matching-view-container .view-all-subscribers-link").empty = noop;
|
||||
$("#buddy-list-other-users-container .view-all-users-link").empty = noop;
|
||||
$(`#buddy-list-users-matching-view .empty-list-message`).remove = noop;
|
||||
$(`#buddy-list-other-users .empty-list-message`).remove = noop;
|
||||
|
Reference in New Issue
Block a user