mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 17:10:12 +01:00
This commit is contained in:
parent
e5703dc70f
commit
08859f198b
4 changed files with 12 additions and 6 deletions
|
|
@ -20,6 +20,7 @@
|
|||
}
|
||||
|
||||
.b3-menu {
|
||||
max-width: 70%;
|
||||
max-height: 50vh;
|
||||
overflow: auto;
|
||||
top: 48px;
|
||||
|
|
|
|||
|
|
@ -515,8 +515,9 @@ export class Wnd {
|
|||
}).element);
|
||||
});
|
||||
window.siyuan.menus.menu.popup({
|
||||
x: event.clientX - 16,
|
||||
x: event.clientX,
|
||||
y: event.clientY,
|
||||
w: 16
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ export class Menu {
|
|||
this.element.innerHTML = "";
|
||||
this.element.removeAttribute("data-filetreeid"); // 用于标记文档数右键所选文档 https://ld246.com/article/1667311960383
|
||||
this.element.classList.add("fn__none");
|
||||
this.element.removeAttribute("style")
|
||||
this.element.removeAttribute("style"); // 页签下拉需要设置 overflow 和 max-height
|
||||
}
|
||||
|
||||
public append(element?: HTMLElement) {
|
||||
|
|
@ -86,7 +86,7 @@ export class Menu {
|
|||
this.element.append(element);
|
||||
}
|
||||
|
||||
public popup(options: { x: number, y: number, h?: number }, isLeft = false) {
|
||||
public popup(options: { x: number, y: number, h?: number , w?: number }, isLeft = false) {
|
||||
if (this.element.innerHTML === "") {
|
||||
return;
|
||||
}
|
||||
|
|
@ -97,7 +97,7 @@ export class Menu {
|
|||
}
|
||||
|
||||
this.element.classList.remove("fn__none");
|
||||
setPosition(this.element, options.x - (isLeft ? window.siyuan.menus.menu.element.clientWidth : 0), options.y, options.h);
|
||||
setPosition(this.element, options.x - (isLeft ? window.siyuan.menus.menu.element.clientWidth : 0), options.y, options.h, options.w);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -266,7 +266,9 @@ export const openFileAttr = (attrs: IObject, id: string, focusName = "bookmark")
|
|||
});
|
||||
}
|
||||
window.siyuan.menus.menu.element.style.zIndex = "310";
|
||||
window.siyuan.menus.menu.popup({x: event.clientX, y: event.clientY + 16});
|
||||
window.siyuan.menus.menu.element.style.overflow = "auto";
|
||||
window.siyuan.menus.menu.element.style.maxHeight = "60vh";
|
||||
window.siyuan.menus.menu.popup({x: event.clientX, y: event.clientY + 16, w: 16});
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
|
@ -471,7 +473,9 @@ export const openAttr = (nodeElement: Element, protyle: IProtyle, focusName = "b
|
|||
});
|
||||
}
|
||||
window.siyuan.menus.menu.element.style.zIndex = "310";
|
||||
window.siyuan.menus.menu.popup({x: event.clientX, y: event.clientY + 16});
|
||||
window.siyuan.menus.menu.element.style.overflow = "auto";
|
||||
window.siyuan.menus.menu.element.style.maxHeight = "60vh";
|
||||
window.siyuan.menus.menu.popup({x: event.clientX, y: event.clientY + 16, w: 16});
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue