From c4ac7f5b033a880173c0c7b2e4b6e5697e6bff00 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Sun, 10 Feb 2019 19:36:36 +0000 Subject: [PATCH] left sidebar: Clean up "split" list moves. This change only impacts users who have the setting to put the user lists in the left sidebar when they have a narrow window. First, we move ".right-sidebar-items" as an entire group. Second, we append the items to "#left-sidebar" instead of ".narrows_panel". --- static/js/resize.js | 10 +++++----- static/styles/right-sidebar.scss | 2 +- templates/zerver/app/right_sidebar.html | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/static/js/resize.js b/static/js/resize.js index cbee4884fc..d95ea94af3 100644 --- a/static/js/resize.js +++ b/static/js/resize.js @@ -224,13 +224,14 @@ exports.resize_page_components = function () { $("#top_navbar").removeClass("rightside-userlist"); + var right_items = $('.right-sidebar-items').expectOne(); + if (css_narrow_mode && !narrow_window) { // move stuff to the left sidebar (skinny mode) narrow_window = true; popovers.set_userlist_placement("left"); - sidebar = $(".narrows_panel").expectOne(); - sidebar.append($("#user-list").expectOne()); - sidebar.append($("#group-pm-list").expectOne()); + sidebar = $("#left-sidebar").expectOne(); + sidebar.append(right_items); $("#buddy_list_wrapper").css("margin", "0px"); $("#group-pms").css("margin", "0px"); $("#userlist-toggle").css("display", "none"); @@ -240,8 +241,7 @@ exports.resize_page_components = function () { narrow_window = false; popovers.set_userlist_placement("right"); sidebar = $("#right-sidebar").expectOne(); - sidebar.append($("#user-list").expectOne()); - sidebar.append($("#group-pm-list").expectOne()); + sidebar.append(right_items); $("#buddy_list_wrapper").css("margin", ''); $("#group-pms").css("margin", ''); $("#userlist-toggle").css("display", ''); diff --git a/static/styles/right-sidebar.scss b/static/styles/right-sidebar.scss index 844858d56a..22dfd28eb1 100644 --- a/static/styles/right-sidebar.scss +++ b/static/styles/right-sidebar.scss @@ -220,7 +220,7 @@ margin-right: 10px; } -.sidebar-items:first-of-type #userlist-header { +.right-sidebar-items:first-of-type #userlist-header { border-top: none; } diff --git a/templates/zerver/app/right_sidebar.html b/templates/zerver/app/right_sidebar.html index dbed5cfef6..c1fc126e78 100644 --- a/templates/zerver/app/right_sidebar.html +++ b/templates/zerver/app/right_sidebar.html @@ -1,5 +1,5 @@