refactor: Rename bottom_sidebar to narrows_panel.

The name `bottom_sidebar` was misleading, because it
includes the entire "normal" left sidebar.

It includes the 4 narrow links at the top plus the
stream/topic list.

We now call is narrows_panel.

Note that the left sidebar sometimes also includes
the user list (with a display setting turned on).

And it will eventually include other views.

We also remove an intermediate value in the resize
calculations.
This commit is contained in:
Steve Howell 2019-02-10 01:04:14 +00:00 committed by Tim Abbott
parent e0a51948d9
commit 039daa2bfa
4 changed files with 11 additions and 17 deletions

View File

@ -56,15 +56,12 @@ function get_new_heights() {
res.main_div_min_height = viewport_height - top_navbar_height;
res.bottom_sidebar_height = viewport_height
- parseInt($("#left-sidebar").css("marginTop"), 10)
- parseInt($(".bottom_sidebar").css("marginTop"), 10)
- parseInt($(".bottom_sidebar").css("marginBottom"), 10);
res.right_sidebar_height = viewport_height - parseInt($("#right-sidebar").css("marginTop"), 10);
res.stream_filters_max_height =
res.bottom_sidebar_height
res.stream_filters_max_height = viewport_height
- parseInt($("#left-sidebar").css("marginTop"), 10)
- parseInt($(".narrows_panel").css("marginTop"), 10)
- parseInt($(".narrows_panel").css("marginBottom"), 10)
- $("#global_filters").safeOuterHeight(true)
- $("#streams_header").safeOuterHeight(true);
@ -122,13 +119,10 @@ function left_userlist_get_new_heights() {
res.main_div_min_height = viewport_height - top_navbar_height;
res.bottom_sidebar_height = viewport_height
res.total_leftlist_height = viewport_height
- parseInt($("#left-sidebar").css("marginTop"), 10)
- parseInt($(".bottom_sidebar").css("marginTop"), 10)
- parseInt($(".bottom_sidebar").css("marginBottom"), 10);
res.total_leftlist_height = res.bottom_sidebar_height
- parseInt($(".narrows_panel").css("marginTop"), 10)
- parseInt($(".narrows_panel").css("marginBottom"), 10)
- $("#global_filters").safeOuterHeight(true)
- $("#streams_header").safeOuterHeight(true)
- $("#userlist-header").safeOuterHeight(true)
@ -234,7 +228,7 @@ exports.resize_page_components = function () {
// move stuff to the left sidebar (skinny mode)
narrow_window = true;
popovers.set_userlist_placement("left");
sidebar = $(".bottom_sidebar").expectOne();
sidebar = $(".narrows_panel").expectOne();
sidebar.append($("#user-list").expectOne());
sidebar.append($("#group-pm-list").expectOne());
$("#buddy_list_wrapper").css("margin", "0px");

View File

@ -53,7 +53,7 @@
font-weight: normal;
}
.bottom_sidebar {
.narrows_panel {
margin-bottom: 4px;
}

View File

@ -204,7 +204,7 @@
padding-right: 10px;
}
.column-left.expanded .bottom_sidebar {
.column-left.expanded .narrows_panel {
margin-top: 10px;
}

View File

@ -1,5 +1,5 @@
<div class="left-sidebar" id="left-sidebar" role="navigation">
<div class="bottom_sidebar">
<div class="narrows_panel">
<ul id="global_filters" class="filters">
{# Special-case this link so we don't actually go to page top. #}
<li class="top_left_all_messages global-filter active-filter" title="{{ _('All messages') }} (Esc)">