sidebar/menu: menu should be scrollable

This allows us to scroll menus not fitting into available screen height.
Plays nice with menu hovering, however once you scroll down your menu
you'll temporarily disable the hover-menu-feature.

fixes #6283
This commit is contained in:
Thomas Gelf 2014-05-26 08:18:47 +00:00
parent 9a8965510a
commit ce220c5ea7
2 changed files with 20 additions and 8 deletions

View File

@ -1,4 +1,13 @@
#menu {
max-height: 100%;
overflow: auto;
}
#layout.hoveredmenu #menu {
overflow: visible;
}
#menu, #menu ul { #menu, #menu ul {
margin: 0; margin: 0;
padding: 0; padding: 0;
@ -194,12 +203,15 @@
/* END of Hoverable menu */ /* END of Hoverable menu */
#menu form {
width: 100%;
}
#menu input.search { #menu input.search {
margin: 0 0 0 0.5em; margin: 0;
padding: 0 0.5em 0 2.5em; padding: 0 0.5em 0 3em;
border: none; border: none;
width: 12.5em; width: 100%;
border-radius: 0; border-radius: 0;
height: 2.5em; height: 2.5em;
display: block; display: block;
@ -207,7 +219,7 @@
background-color: transparent; background-color: transparent;
background-image: url('../img/icons/search.png'); background-image: url('../img/icons/search.png');
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: 0.7em center; background-position: 1.2em center;
color: #f5f5f5; color: #f5f5f5;
text-shadow: -1px 1px 0 #555555; text-shadow: -1px 1px 0 #555555;
border-bottom: 1px solid #888; border-bottom: 1px solid #888;
@ -229,11 +241,7 @@
#menu input.search.active { #menu input.search.active {
background-color: white; background-color: white;
color: #121212; color: #121212;
width: 13em;
text-shadow: none; text-shadow: none;
padding-left: 3em;
margin-left: 0;
background-position: 1.2em center;
} }
#menu input.search.active::-moz-placeholder { #menu input.search.active::-moz-placeholder {

View File

@ -147,6 +147,9 @@
if ($li.children('ul').children('li').length === 0) { if ($li.children('ul').children('li').length === 0) {
return; return;
} }
if ($('#menu').scrollTop() > 0) {
return;
}
if ($('#layout').hasClass('hoveredmenu')) { if ($('#layout').hasClass('hoveredmenu')) {
delay = 0; delay = 0;
@ -179,6 +182,7 @@
var $sidebar = $(this); var $sidebar = $(this);
var $li = $sidebar.find('li.hover'); var $li = $sidebar.find('li.hover');
if (! $li.length) { if (! $li.length) {
$('#layout').removeClass('hoveredmenu');
return; return;
} }