mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-16 00:50:56 +08:00
This commit is contained in:
parent
ed0907a74a
commit
4ccdc53dc5
@ -33,9 +33,13 @@ export class Menu {
|
|||||||
itemElement.classList.add("b3-menu__item--show");
|
itemElement.classList.add("b3-menu__item--show");
|
||||||
const rect = subMenuElement.getBoundingClientRect();
|
const rect = subMenuElement.getBoundingClientRect();
|
||||||
let style = "";
|
let style = "";
|
||||||
if (rect.right > window.innerWidth && (rect.left - this.element.clientWidth - rect.width > 0 ||
|
const leftPosition = rect.left - this.element.clientWidth - rect.width
|
||||||
Math.abs(rect.left - this.element.clientWidth - rect.width) < (rect.right - window.innerWidth))) {
|
if (rect.right > window.innerWidth && Math.abs(leftPosition) < (rect.right - window.innerWidth)) {
|
||||||
style = "left:auto;right:100%;";
|
if (leftPosition >= 0) {
|
||||||
|
style = "left:auto;right:100%;";
|
||||||
|
} else {
|
||||||
|
style = `z-index:1;mix-blend-mode: normal;left:-${this.element.style.left};`;
|
||||||
|
}
|
||||||
} else if (rect.right > window.innerWidth) {
|
} else if (rect.right > window.innerWidth) {
|
||||||
style = `z-index:1;mix-blend-mode: normal;left:${window.innerWidth - rect.width}px;`;
|
style = `z-index:1;mix-blend-mode: normal;left:${window.innerWidth - rect.width}px;`;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user