mirror of
https://github.com/openvk/openvk
synced 2024-11-11 01:19:53 +03:00
Fix some more contextmenu prikoli in bsdnplayer
This commit is contained in:
parent
344ba53acd
commit
934bc9b25c
1 changed files with 11 additions and 4 deletions
|
@ -147,15 +147,22 @@ function _bsdnEventListenerFactory(el, v) {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
let rect = el.querySelector(".bsdn-player").getBoundingClientRect();
|
let rect = el.querySelector(".bsdn-player").getBoundingClientRect();
|
||||||
|
|
||||||
let h = rect.height, w = rect.width;
|
let h = rect.height, w = rect.width;
|
||||||
let x = e.pageX - rect.x, y = e.pageY - rect.y;
|
let x, y;
|
||||||
|
if(document.fullscreen) {
|
||||||
|
x = e.screenX;
|
||||||
|
y = e.screenY;
|
||||||
|
} else {
|
||||||
|
let rx = rect.x + window.scrollX, ry = rect.y + window.scrollY;
|
||||||
|
x = e.pageX - rx;
|
||||||
|
y = e.pageY - ry;
|
||||||
|
}
|
||||||
|
|
||||||
if(h - y < 169)
|
if(h - y < 169)
|
||||||
y -= 169;
|
y = Math.max(0, y - 169);
|
||||||
|
|
||||||
if(w - x < 238)
|
if(w - x < 238)
|
||||||
x -= 238;
|
x = Math.max(0, x - 238);
|
||||||
|
|
||||||
let menu = el.querySelector(".bsdn_contextMenu");
|
let menu = el.querySelector(".bsdn_contextMenu");
|
||||||
menu.style.top = y + "px";
|
menu.style.top = y + "px";
|
||||||
|
|
Loading…
Reference in a new issue