From fefcaad027b8a6937d765eef081a95dcd0031a4a Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Wed, 27 May 2020 21:00:51 +0000 Subject: [PATCH] resize: Avoid hard-coding 10px for header padding. --- static/js/panels.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/static/js/panels.js b/static/js/panels.js index 422cfcdae1..6d903363ac 100644 --- a/static/js/panels.js +++ b/static/js/panels.js @@ -2,9 +2,13 @@ const util = require("./util"); const resize_app = function () { const 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"); + + // the floating recipient bar is usually positioned right below + // the `.header` element (including padding). + const frb_top = panels_height + + $('.header').height() + + parseInt($(".header").css("paddingBottom"), 10); + $("#floating_recipient_bar").css("top", frb_top + "px"); }; exports.resize_app = resize_app;