mirror of
https://github.com/45Drives/cockpit-navigator.git
synced 2025-07-29 08:34:50 +02:00
flip contextmenu if too low
This commit is contained in:
parent
e36a0995fa
commit
2f987f790a
@ -919,7 +919,13 @@ class NavContextMenu {
|
||||
this.target = target;
|
||||
this.dom_element.style.display = "inline";
|
||||
this.dom_element.style.left = event.clientX + "px";
|
||||
this.dom_element.style.top = event.clientY + "px";
|
||||
var height = this.dom_element.getBoundingClientRect().height;
|
||||
var max_height = window.innerHeight;
|
||||
if (event.clientY > max_height - height) {
|
||||
this.dom_element.style.top = event.clientY - height + "px";
|
||||
} else {
|
||||
this.dom_element.style.top = event.clientY + "px";
|
||||
}
|
||||
}
|
||||
|
||||
hide() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user