mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-06-21 00:00:35 +00:00
fixed scrollbar in left menu
This commit is contained in:
parent
b39d9528ab
commit
2294a54b36
2 changed files with 11 additions and 3 deletions
static/js
|
@ -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');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue