Sidebar - fix for too long a-link list (#4684)

This commit is contained in:
René 2021-02-10 15:47:01 +01:00 committed by GitHub
parent 831fcec40b
commit 75a7e2131a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,7 +43,8 @@ $(document).ready(function () {
mainmenu = $('#mainmenu'),
countA = $('#mainmenu > div > a').length,
footH = $('.page-foot').height(),
headerH = $('.navbar-header').height(),
headerH = $('.navbar').height(),
li_itemH = $('a.list-group-item').height(),
navHeight = (countA * 70) + ((footH + headerH) - (20 + countA)),
events = {
mouseenter: function () {
@ -59,8 +60,9 @@ $(document).ready(function () {
var currentHeight = (divTop + divHeight);
var thatTrigger = that.trigger('click');
close_submenu(this);
if (currentHeight > winHeight) {
var result = that.next('div').css('margin-top', -divHeight - (that.is(layer1_a) ? 3 : 0));
if (currentHeight > (winHeight - li_itemH)) {
var divPos = ((divHeight - li_itemH) > divTop) ? -(((divHeight - li_itemH) - divTop)) : 3;
var viewresult = that.next('div').css('margin-top', -divHeight - (that.is(layer1_a) ? divPos : 0));
}
}
},