mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-01 14:28:49 +01:00
🎨
This commit is contained in:
parent
c61161615f
commit
c7cc5e6510
2 changed files with 6 additions and 5 deletions
|
|
@ -56,14 +56,14 @@ export class Menu {
|
|||
}
|
||||
|
||||
public showSubMenu(subMenuElement: HTMLElement) {
|
||||
const parentRect = subMenuElement.parentElement.getBoundingClientRect();
|
||||
subMenuElement.style.top = (parentRect.top - 8) + "px";
|
||||
subMenuElement.style.left = (parentRect.right + 8) + "px";
|
||||
const itemRect = subMenuElement.parentElement.getBoundingClientRect();
|
||||
subMenuElement.style.top = (itemRect.top - 8) + "px";
|
||||
subMenuElement.style.left = (itemRect.right + 8) + "px";
|
||||
subMenuElement.style.bottom = "auto";
|
||||
const rect = subMenuElement.getBoundingClientRect();
|
||||
if (rect.right > window.innerWidth) {
|
||||
if (parentRect.left - 8 > rect.width) {
|
||||
subMenuElement.style.left = (parentRect.left - 8 - rect.width) + "px";
|
||||
if (itemRect.left - 8 > rect.width) {
|
||||
subMenuElement.style.left = (itemRect.left - 8 - rect.width) + "px";
|
||||
} else {
|
||||
subMenuElement.style.left = (window.innerWidth - rect.width) + "px";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -630,6 +630,7 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, clo
|
|||
event.preventDefault();
|
||||
break;
|
||||
} else if (target.id === "searchFilter") {
|
||||
window.siyuan.menus.menu.remove();
|
||||
filterMenu(config, () => {
|
||||
config.page = 1;
|
||||
inputEvent(element, config, undefined, edit, true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue