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.

user_profile: Use grid layout for stream search input.

Sahil Batrac4058ffc22a4
diff --git a/web/src/user_profile.ts b/web/src/user_profile.ts
index 3d5cfd5f6f3..e52e1590c4d 100644
--- a/web/src/user_profile.ts
+++ b/web/src/user_profile.ts
@@ -1312,10 +1312,8 @@ export function initialize(): void {
const $input = $<HTMLInputElement>("#user-profile-streams-tab input.stream-search");
if ($input.val()!.trim().length > 0) {
$("#user-profile-streams-tab #clear_stream_search").show();
- $input.css("margin-right", "-20px");
} else {
$("#user-profile-streams-tab #clear_stream_search").hide();
- $input.css("margin-right", "0");
}
});
diff --git a/web/styles/popovers.css b/web/styles/popovers.css
index 81ecaa8a784..f86bbbd6227 100644
--- a/web/styles/popovers.css
+++ b/web/styles/popovers.css
@@ -617,21 +617,32 @@ ul.popover-group-menu-member-list {
.stream-list-top-section {
display: flex;
margin-top: 12px;
+ align-items: center;
+ margin-bottom: 5px;
- .stream-search {
+ .stream-search-container {
margin-left: auto;
- align-self: center;
+ display: grid;
+ grid-template:
+ "search-input clear-search" auto / minmax(0, 1fr)
+ 30px;
+ }
+
+ .stream-search {
+ grid-column: search-input-start / clear-search-end;
+ grid-row: search-input;
padding-right: 20px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
+ margin-bottom: 0;
}
#clear_stream_search {
display: none;
- padding: 5px 8px 5px 4px;
- position: relative;
+ grid-area: clear-search;
right: 0;
+ padding: 0;
}
}
diff --git a/web/templates/user_profile_modal.hbs b/web/templates/user_profile_modal.hbs
index 1624debae76..68cb122ee4d 100644
--- a/web/templates/user_profile_modal.hbs
+++ b/web/templates/user_profile_modal.hbs
@@ -117,10 +117,12 @@
<div class="header-section">
<h3 class="stream-tab-element-header">{{t 'Subscribed channels' }}</h3>
</div>
- <input type="text" class="stream-search modal_text_input" placeholder="{{t 'Filter channels' }}" />
- <button type="button" class="clear_search_button" id="clear_stream_search">
- <i class="fa fa-remove" aria-hidden="true"></i>
- </button>
+ <div class="stream-search-container">
+ <input type="text" class="stream-search modal_text_input" placeholder="{{t 'Filter channels' }}" />
+ <button type="button" class="clear_search_button" id="clear_stream_search">
+ <i class="fa fa-remove" aria-hidden="true"></i>
+ </button>
+ </div>
</div>
<div class="subscription-stream-list empty-list">
<table class="user-stream-list" data-empty="{{t 'No channel subscriptions.'}}" data-search-results-empty="{{t 'No matching channels' }}"></table>