Moves posting code for keyboard triggered menus.
This commit is contained in:
parent
583f4a60dc
commit
66b56d9ac9
|
@ -301,13 +301,13 @@
|
||||||
x = event.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
|
x = event.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
|
||||||
y = event.clientY + document.body.scrollTop + document.documentElement.scrollTop;
|
y = event.clientY + document.body.scrollTop + document.documentElement.scrollTop;
|
||||||
}
|
}
|
||||||
|
if (!parent) {
|
||||||
var node = MENU.CurrentNode() || event.target;
|
var node = MENU.CurrentNode() || event.target;
|
||||||
if (!x && !y && node) {
|
if (!x && !y && node) {
|
||||||
var rect = node.getBoundingClientRect();
|
var rect = node.getBoundingClientRect();
|
||||||
x = rect.right;
|
x = rect.right;
|
||||||
y = rect.bottom;
|
y = rect.bottom;
|
||||||
}
|
}
|
||||||
if (!parent) {
|
|
||||||
if (x + menu.offsetWidth > document.body.offsetWidth - this.margin)
|
if (x + menu.offsetWidth > document.body.offsetWidth - this.margin)
|
||||||
{x = document.body.offsetWidth - menu.offsetWidth - this.margin}
|
{x = document.body.offsetWidth - menu.offsetWidth - this.margin}
|
||||||
if (MENU.isMobile) {x = Math.max(5,x-Math.floor(menu.offsetWidth/2)); y -= 20}
|
if (MENU.isMobile) {x = Math.max(5,x-Math.floor(menu.offsetWidth/2)); y -= 20}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user