fixed scroll top bug in fixed layout mode

This commit is contained in:
REJack 2019-07-08 13:37:49 +02:00
parent f6a5d05c90
commit a1734eabda
No known key found for this signature in database
GPG key ID: 9F3976CC630CC888
3 changed files with 15 additions and 7 deletions

View file

@ -23,6 +23,8 @@
layoutBoxed : '.layout-boxed',
mainFooter : '.main-footer',
mainHeader : '.main-header',
mainSidebar : '.main-sidebar',
slimScrollDiv : 'slimScrollDiv',
sidebar : '.sidebar',
controlSidebar: '.control-sidebar',
fixed : '.fixed',
@ -130,9 +132,11 @@
// $(Selector.sidebar).slimScroll({ destroy: true }).height('auto')
// Add slimscroll
$(Selector.sidebar).slimScroll({
height: ($(window).height() - $(Selector.mainHeader).height()) + 'px'
});
if ($(Selector.mainSidebar).find(Selector.slimScrollDiv).length === 0) {
$(Selector.sidebar).slimScroll({
height: ($(window).height() - $(Selector.mainHeader).height()) + 'px'
});
}
}
}
};

10
dist/js/adminlte.js vendored
View file

@ -986,6 +986,8 @@ throw new Error('AdminLTE requires jQuery')
layoutBoxed : '.layout-boxed',
mainFooter : '.main-footer',
mainHeader : '.main-header',
mainSidebar : '.main-sidebar',
slimScrollDiv : 'slimScrollDiv',
sidebar : '.sidebar',
controlSidebar: '.control-sidebar',
fixed : '.fixed',
@ -1093,9 +1095,11 @@ throw new Error('AdminLTE requires jQuery')
// $(Selector.sidebar).slimScroll({ destroy: true }).height('auto')
// Add slimscroll
$(Selector.sidebar).slimScroll({
height: ($(window).height() - $(Selector.mainHeader).height()) + 'px'
});
if ($(Selector.mainSidebar).find(Selector.slimScrollDiv).length === 0) {
$(Selector.sidebar).slimScroll({
height: ($(window).height() - $(Selector.mainHeader).height()) + 'px'
});
}
}
}
};

File diff suppressed because one or more lines are too long