From 7ddf6435a99dc0f16a652f47b85e64611f9c0a06 Mon Sep 17 00:00:00 2001 From: Gaurav Pandey Date: Mon, 1 Mar 2021 11:03:11 +0530 Subject: [PATCH] left-sidebar: Remove add-streams option out of scrollbar. This commit removes the option to add more streams out of scrollbar as it is not visible on mobile devices or organizations with large number of streams until scrolled down. --- static/js/resize.js | 4 +++- static/styles/left_sidebar.css | 3 +-- templates/zerver/app/left_sidebar.html | 10 +++++----- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/static/js/resize.js b/static/js/resize.js index 15a3efa7f5..064cedfe7c 100644 --- a/static/js/resize.js +++ b/static/js/resize.js @@ -40,6 +40,7 @@ function get_new_heights() { const viewport_height = message_viewport.height(); const top_navbar_height = $("#top_navbar").safeOuterHeight(true); const invite_user_link_height = $("#invite-user-link").safeOuterHeight(true) || 0; + const add_streams_link_height = $("#add-stream-link").safeOuterHeight(true) || 0; res.bottom_whitespace_height = viewport_height * 0.4; @@ -51,7 +52,8 @@ function get_new_heights() { Number.parseInt($(".narrows_panel").css("marginTop"), 10) - Number.parseInt($(".narrows_panel").css("marginBottom"), 10) - $("#global_filters").safeOuterHeight(true) - - $("#streams_header").safeOuterHeight(true); + $("#streams_header").safeOuterHeight(true) - + add_streams_link_height; // Don't let us crush the stream sidebar completely out of view res.stream_filters_max_height = Math.max(80, res.stream_filters_max_height); diff --git a/static/styles/left_sidebar.css b/static/styles/left_sidebar.css index 645978e5f3..17ce10ae66 100644 --- a/static/styles/left_sidebar.css +++ b/static/styles/left_sidebar.css @@ -78,7 +78,7 @@ li.show-more-topics { #stream_filters { overflow: visible; - margin-bottom: 10px; + margin-bottom: 5px; margin-right: 12px; padding: 0; font-weight: normal; @@ -175,7 +175,6 @@ li.show-more-topics { #add-stream-link { text-decoration: none; margin-left: 10px; - margin-bottom: 18px; i { min-width: 19px; text-align: center; diff --git a/templates/zerver/app/left_sidebar.html b/templates/zerver/app/left_sidebar.html index e736c973e4..b5812b6b7e 100644 --- a/templates/zerver/app/left_sidebar.html +++ b/templates/zerver/app/left_sidebar.html @@ -82,12 +82,12 @@
- {% if show_add_streams %} - - {% endif %}
+ {% if show_add_streams %} + + {% endif %}