diff --git a/public/css/icinga/menu.less b/public/css/icinga/menu.less index e9ed78808f..128e20c9e0 100644 --- a/public/css/icinga/menu.less +++ b/public/css/icinga/menu.less @@ -254,6 +254,7 @@ width: 14em; position: fixed; z-index: 1; + overflow: auto; &:after { .transform(rotate(45deg)); diff --git a/public/js/icinga/behavior/navigation.js b/public/js/icinga/behavior/navigation.js index 850f9d88b8..58552d4ac0 100644 --- a/public/js/icinga/behavior/navigation.js +++ b/public/js/icinga/behavior/navigation.js @@ -320,6 +320,8 @@ $target.addClass('hover'); var targetHeight = $target.offset().top + $target.outerHeight(); + var distanceFromEdge = 10; + var maxHeight = window.innerHeight - targetHeight - distanceFromEdge; $flyout.css({ bottom: 'auto', top: targetHeight @@ -327,15 +329,19 @@ var rect = $flyout[0].getBoundingClientRect(); - if (rect.bottom > window.innerHeight && rect.height < targetHeight) { + if (rect.bottom > window.innerHeight - distanceFromEdge && rect.height < targetHeight) { $flyout.addClass('bottom-up'); $flyout.css({ bottom: window.innerHeight - targetHeight, top: 'auto' }); + + maxHeight = targetHeight - distanceFromEdge; } else { $flyout.removeClass('bottom-up'); } + + $flyout.css({'max-height': maxHeight}); }, delay); }; @@ -362,6 +368,10 @@ } } catch(e) { /* Bypass because if IE8 */ }; $hovered.removeClass('hover'); + var $inlineStyleElement = $hovered.find('.nav-level-2'); + if ($inlineStyleElement.length) { + $inlineStyleElement.removeAttr('style'); + } $layout.removeClass('menu-hovered'); }, 600); };