From 96c66d4297848f80de6f0d20db8526f3e6831eb6 Mon Sep 17 00:00:00 2001 From: Brock Whittaker Date: Thu, 12 Oct 2017 15:13:51 -0700 Subject: [PATCH] panels: Make them mobile responsive. This makes them responsive to resizes and fixes a responsive issue with the floating recipient being too high when the alerts were more than one line height. --- static/js/desktop_notifications_panel.js | 5 +++++ static/js/resize.js | 2 ++ 2 files changed, 7 insertions(+) diff --git a/static/js/desktop_notifications_panel.js b/static/js/desktop_notifications_panel.js index 68c7bf8178..bea1b79d81 100644 --- a/static/js/desktop_notifications_panel.js +++ b/static/js/desktop_notifications_panel.js @@ -5,8 +5,13 @@ var exports = {}; var resize_app = function () { var panels_height = $("#panels").height(); $("body > .app").height("calc(100% - " + panels_height + "px)"); + // the floating recipient bar is usually positioned 10px below the + // header, so add that to the panels height to get the new `top` value. + $("#floating_recipient_bar").css("top", panels_height + $(".header").height() + 10 + "px"); }; +exports.resize_app = resize_app; + var show_step = function (step) { $("#panels [data-step]").hide().filter("[data-step=" + step + "]").show(); }; diff --git a/static/js/resize.js b/static/js/resize.js index cb8e69d486..c9557e6dc9 100644 --- a/static/js/resize.js +++ b/static/js/resize.js @@ -264,6 +264,8 @@ exports.resize_page_components = function () { activity.update_scrollbar.users(); activity.update_scrollbar.group_pms(); + + desktop_notifications_panel.resize_app(); }; var _old_width = $(window).width();