Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
sukhwinder33445 committed Aug 12, 2024
1 parent ead1123 commit 2e41d1e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions public/css/icinga/menu.less
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@
width: 14em;
position: fixed;
z-index: 1;
overflow: auto;

&:after {
.transform(rotate(45deg));
Expand Down
12 changes: 11 additions & 1 deletion public/js/icinga/behavior/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,22 +320,28 @@
$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
});

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);
};

Expand All @@ -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);
};
Expand Down

0 comments on commit 2e41d1e

Please sign in to comment.