Tweak forum topic browse menu

The filter box will now remain fixed while the rest of the menu scrolls.
This also fixes a minor cosmetic bug in which the thread list would
overflow its container if the user opened the browse menu, scrolled the
page, and then closed the browse menu.
This commit is contained in:
Greg Price
2014-07-03 14:09:44 -04:00
parent 890eba26e2
commit f3a8436e68
2 changed files with 8 additions and 2 deletions

View File

@@ -107,8 +107,9 @@ if Backbone?
headerHeight = @$(".forum-nav-header").outerHeight()
refineBarHeight = @$(".forum-nav-refine-bar").outerHeight()
browseFilterHeight = @$(".forum-nav-browse-filter").outerHeight()
@$('.forum-nav-thread-list').css('height', (sidebarHeight - headerHeight - refineBarHeight - 2) + 'px')
@$('.forum-nav-browse-menu-wrapper').css('height', (sidebarHeight - headerHeight - 2) + 'px')
@$('.forum-nav-browse-menu').css('height', (sidebarHeight - headerHeight - browseFilterHeight - 2) + 'px')
# Because we want the behavior that when the body is clicked the menu is
@@ -267,6 +268,7 @@ if Backbone?
@$(".forum-nav-thread-list-wrapper").hide()
$(".forum-nav-browse-filter-input").focus()
$("body").bind "click", @hideBrowseMenu
@updateSidebar()
hideBrowseMenu: =>
if @isBrowseMenuVisible()
@@ -274,6 +276,7 @@ if Backbone?
@$(".forum-nav-browse-menu-wrapper").hide()
@$(".forum-nav-thread-list-wrapper").show()
$("body").unbind "click", @hideBrowseMenu
@updateSidebar()
toggleBrowseMenu: (event) =>
event.preventDefault()

View File

@@ -64,7 +64,6 @@
// Browse menu
// -----------
.forum-nav-browse-menu-wrapper {
overflow-y: scroll;
border-bottom: 1px solid $gray-l3;
background: $gray-l5;
}
@@ -87,6 +86,10 @@
width: 100%;
}
.forum-nav-browse-menu {
overflow-y: scroll;
}
.forum-nav-browse-title .icon {
margin-right: ($baseline/2);
}