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)
This commit is contained in:
Waseem Daher 2012-12-04 22:55:08 -05:00
parent 7e4776322d
commit f3ba899fe1
1 changed files with 9 additions and 4 deletions

View File

@ -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);