From daf06b9bebedadfb2cf76120c044cf6a9a47b1f3 Mon Sep 17 00:00:00 2001 From: Waseem Daher Date: Mon, 15 Oct 2012 15:57:30 -0400 Subject: [PATCH] Hack around visibility: collapse for Chrome. (imported from commit 25e6453fe6fa1c5a3c72f56bec2e4bbb089edb4f) --- zephyr/static/js/ui.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/zephyr/static/js/ui.js b/zephyr/static/js/ui.js index b16097fced..a39e83cba8 100644 --- a/zephyr/static/js/ui.js +++ b/zephyr/static/js/ui.js @@ -190,6 +190,19 @@ function update_floating_recipient_bar() { // If we've gotten this far, well, show it. replace_narrowbar(current_label); } +function hack_for_floating_recipient_bar() { + // So, as of this writing, Firefox respects visibility: collapse, + // but WebKit does not (at least, my Chrome doesn't.) Instead it + // renders it basically as visibility: hidden, which leaves a + // slight gap that our messages peek through as they scroll + // by. This hack fixes this by programmatically measuring how big + // the gap is, and then moving our table up to compensate. + var gap = $("#floating_recipient_layout_row").outerHeight(true); + var floating_recipient = $(".floating_recipient"); + var offset = floating_recipient.offset(); + offset.top = offset.top - gap; + floating_recipient.offset(offset); +} $(function () { // NB: This just binds to current elements, and won't bind to elements @@ -308,6 +321,7 @@ $(function () { // the exact right width for the narrowbar and compose box, // but, close enough for now. resizehandler(); + hack_for_floating_recipient_bar(); // limit number of items so the list doesn't fall off the screen $( "#stream" ).typeahead({