From f3ba899fe1ed2c0d92583caa4b1bbb9b5c7e2d38 Mon Sep 17 00:00:00 2001 From: Waseem Daher Date: Tue, 4 Dec 2012 22:55:08 -0500 Subject: [PATCH] Fix responsive layout on Subscriptions and Settings page. This was a really cute bug where our layout messes up if you resize the page while "Subscriptions" (or to a less visible extent, "Settings") is active. The problem here is that we compute the size of the top navbar based on the size of main_div -- but when main_div is hidden, it has a width of zero! We need to instead look at the width of the pane that *is* active. Resolves https://trac.humbughq.com/ticket/216 (imported from commit adbef00d190845f90c5cfdb46df4ec7b703635ef) --- zephyr/static/js/ui.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/zephyr/static/js/ui.js b/zephyr/static/js/ui.js index 0d8e72af28..1e1d0cbcdb 100644 --- a/zephyr/static/js/ui.js +++ b/zephyr/static/js/ui.js @@ -112,10 +112,15 @@ function resizehandler(e) { top_statusbar.css('top', space_taken_up_by_navbar); - var message_list_width = $("#main_div").outerWidth(); - composebox.width(message_list_width); - top_statusbar.width(message_list_width); - sidebar_nav.width(message_list_width); + var desired_width; + if (exports.home_tab_obscured() === 'other_tab') { + desired_width = $("div.tab-pane.active").outerWidth(); + } else { + desired_width = $("#main_div").outerWidth(); + composebox.width(desired_width); + } + top_statusbar.width(desired_width); + sidebar_nav.width(desired_width); } else { sidebar.addClass('nav-stacked'); top_statusbar.css('top', 0);