#566 When you display the context panel on the right of the screen, the text is not aligned

master
agriyadev5 2021-06-04 14:08:21 +05:30
parent 5143035f6f
commit 0b95438318
1 changed files with 15 additions and 2 deletions

View File

@ -306,8 +306,21 @@ export class SeCMenuDialog extends HTMLElement {
const current = this;
const onMenuOpenHandler = (e) => {
e.preventDefault();
current.$dialog.style.top = e.pageY + 'px';
current.$dialog.style.left = e.pageX + 'px';
// Detect mouse position
let x = e.pageX;
let y = e.pageY;
const xOff = screen.width - 250; // menu width
const yOff = screen.height - (276 + 150); // menu height + bottom panel height and scroll bar
if (x > xOff) {
x = xOff;
}
if (y > yOff) {
y = yOff;
}
current.$dialog.style.top = y + 'px';
current.$dialog.style.left = x + 'px';
current.$dialog.style.display = 'block';
};
const onMenuCloseHandler = (e) => {