wip: Add ban and kick to context menu #69
1 changed files with 4 additions and 0 deletions
|
@ -18,6 +18,10 @@ onMounted(() => {
|
||||||
if (contextMenu) {
|
if (contextMenu) {
|
||||||
contextMenu.style.left = props.pointerX.toString() + "px";
|
contextMenu.style.left = props.pointerX.toString() + "px";
|
||||||
contextMenu.style.top = props.pointerY.toString() + "px";
|
contextMenu.style.top = props.pointerY.toString() + "px";
|
||||||
|
const rect = contextMenu.getBoundingClientRect();
|
||||||
|
if (rect.right > (window.innerWidth || document.documentElement.clientWidth)) {
|
||||||
|
contextMenu.style.left = (props.pointerX - contextMenu.clientWidth).toString() + "px";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue