From eb83ea3b9f0f09028b82e4dfedbf76b0b9b94a54 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 16 Oct 2010 12:07:31 -0600 Subject: [PATCH] /browse: Proper resizing of top level grid view --- resources/content_server/browse/browse.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/resources/content_server/browse/browse.js b/resources/content_server/browse/browse.js index 99755f5f99..777a285878 100644 --- a/resources/content_server/browse/browse.js +++ b/resources/content_server/browse/browse.js @@ -74,6 +74,14 @@ function init() { } // Top-level feed {{{ + +function toplevel_layout() { + var last = $(".toplevel li").last(); + var title = $('.toplevel h3').first(); + var bottom = last.position().top + last.height() - title.position().top; + $("#main").height(Math.max(200, bottom)); +} + function toplevel() { $(".sort_select").hide(); @@ -82,10 +90,8 @@ function toplevel() { window.location = href; }); - - var last = $(".toplevel li").last(); - var bottom = last.position().top + last.height(); - $("#main").height(Math.max(680, bottom+150)); + toplevel_layout(); + $(window).resize(toplevel_layout); } // }}}