fixed scrollbar in left menu

This commit is contained in:
matcornic 2017-07-31 23:20:05 +02:00
parent b39d9528ab
commit 2294a54b36
2 changed files with 11 additions and 3 deletions
static/js

View file

@ -25,6 +25,11 @@ function getScrollBarWidth() {
return (w1 - w2);
};
function setMenuHeight() {
$('#sidebar .highlightable').height($('#sidebar').innerHeight() - $('#header-wrapper').height() - 40);
$('#sidebar .highlightable').perfectScrollbar('update');
}
function fallbackMessage(action) {
var actionMsg = '';
var actionKey = (action === 'cut' ? 'X' : 'C');
@ -44,6 +49,7 @@ function fallbackMessage(action) {
// for the window resize
$(window).resize(function() {
setMenuHeight();
});
// debouncing function from John Hann
@ -84,6 +90,8 @@ jQuery(document).ready(function() {
});
var sidebarStatus = searchStatus = 'open';
$('#sidebar .highlightable').perfectScrollbar();
setMenuHeight();
jQuery('#overlay').on('click', function() {
jQuery(document.body).toggleClass('sidebar-hidden');