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.

popovers: Close user popover when clicked on stream name.

aryanshridhar8cd9fc7a7411
diff --git a/static/js/popovers.js b/static/js/popovers.js
index 8cf74760aef..98fd71ff6e7 100644
--- a/static/js/popovers.js
+++ b/static/js/popovers.js
@@ -1132,10 +1132,17 @@ export function register_click_handlers() {
e.preventDefault();
});
+ /* These click handlers are implemented as just deep links to the
+ * relevant part of the Zulip UI, so we don't want preventDefault,
+ * but we do want to close the modal when you click them. */
$("body").on("click", "#user-profile-modal #name #edit-button", () => {
hide_user_profile();
});
+ $("body").on("click", "#user-profile-modal .stream_list_item", () => {
+ hide_user_profile();
+ });
+
$("body").on("click", ".compose_mobile_button", function (e) {
show_mobile_message_buttons_popover(this);
e.stopPropagation();
diff --git a/static/templates/user_stream_list_item.hbs b/static/templates/user_stream_list_item.hbs
index 6e0de610dfb..0d094c4899d 100644
--- a/static/templates/user_stream_list_item.hbs
+++ b/static/templates/user_stream_list_item.hbs
@@ -3,6 +3,6 @@
<span id="stream_sidebar_privacy_swatch_{{stream_id}}" class="stream-privacy filter-icon" style="color: {{stream_color}}">
{{> stream_privacy }}
</span>
- <a href="{{stream_edit_url}}">{{name}}</a>
+ <a class = "stream_list_item" href="{{stream_edit_url}}">{{name}}</a>
</td>
</tr>