mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-12 23:21:23 +08:00
This commit is contained in:
parent
bfa4e8af7a
commit
99cf40b12d
@ -215,8 +215,11 @@ export class BlockPanel {
|
|||||||
this.element = undefined;
|
this.element = undefined;
|
||||||
this.targetElement = undefined;
|
this.targetElement = undefined;
|
||||||
// 移除弹出上使用右键菜单
|
// 移除弹出上使用右键菜单
|
||||||
|
if (window.siyuan.menus.menu.element.dataset.from !== "app") {
|
||||||
|
// https://github.com/siyuan-note/siyuan/issues/9854 右键菜单不是从浮窗中弹出的则不进行移除
|
||||||
window.siyuan.menus.menu.remove();
|
window.siyuan.menus.menu.remove();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private render() {
|
private render() {
|
||||||
if (!document.body.contains(this.element)) {
|
if (!document.body.contains(this.element)) {
|
||||||
|
@ -109,6 +109,7 @@ export class Menu {
|
|||||||
this.element.classList.remove("b3-menu--list", "b3-menu--fullscreen");
|
this.element.classList.remove("b3-menu--list", "b3-menu--fullscreen");
|
||||||
this.element.removeAttribute("style"); // zIndex
|
this.element.removeAttribute("style"); // zIndex
|
||||||
window.siyuan.menus.menu.element.removeAttribute("data-name"); // 标识再次点击不消失
|
window.siyuan.menus.menu.element.removeAttribute("data-name"); // 标识再次点击不消失
|
||||||
|
window.siyuan.menus.menu.element.removeAttribute("data-from"); // 标识是否在浮窗内打开
|
||||||
}
|
}
|
||||||
|
|
||||||
public append(element?: HTMLElement, index?: number) {
|
public append(element?: HTMLElement, index?: number) {
|
||||||
|
@ -279,7 +279,7 @@ export const fileAnnotationRefMenu = (protyle: IProtyle, refElement: HTMLElement
|
|||||||
y: rect.top + 26,
|
y: rect.top + 26,
|
||||||
h: 26
|
h: 26
|
||||||
});
|
});
|
||||||
|
window.siyuan.menus.menu.element.setAttribute("data-from", hasClosestByClassName(protyle.element, "block__edit") ? "popover" : "app");
|
||||||
anchorElement.select();
|
anchorElement.select();
|
||||||
window.siyuan.menus.menu.removeCB = () => {
|
window.siyuan.menus.menu.removeCB = () => {
|
||||||
if (nodeElement.outerHTML !== oldHTML) {
|
if (nodeElement.outerHTML !== oldHTML) {
|
||||||
@ -583,6 +583,7 @@ export const refMenu = (protyle: IProtyle, element: HTMLElement) => {
|
|||||||
y: rect.top + 26,
|
y: rect.top + 26,
|
||||||
h: 26
|
h: 26
|
||||||
});
|
});
|
||||||
|
window.siyuan.menus.menu.element.setAttribute("data-from", hasClosestByClassName(protyle.element, "block__edit") ? "popover" : "app")
|
||||||
if (!protyle.disabled) {
|
if (!protyle.disabled) {
|
||||||
window.siyuan.menus.menu.element.querySelector("input").select();
|
window.siyuan.menus.menu.element.querySelector("input").select();
|
||||||
window.siyuan.menus.menu.removeCB = () => {
|
window.siyuan.menus.menu.removeCB = () => {
|
||||||
@ -1062,6 +1063,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
window.siyuan.menus.menu.popup({x: position.clientX, y: position.clientY});
|
window.siyuan.menus.menu.popup({x: position.clientX, y: position.clientY});
|
||||||
|
window.siyuan.menus.menu.element.setAttribute("data-from", hasClosestByClassName(protyle.element, "block__edit") ? "popover" : "app")
|
||||||
if (!protyle.disabled) {
|
if (!protyle.disabled) {
|
||||||
const textElements = window.siyuan.menus.menu.element.querySelectorAll("textarea");
|
const textElements = window.siyuan.menus.menu.element.querySelectorAll("textarea");
|
||||||
textElements[0].focus();
|
textElements[0].focus();
|
||||||
@ -1248,6 +1250,7 @@ export const linkMenu = (protyle: IProtyle, linkElement: HTMLElement, focusText
|
|||||||
y: rect.top + 26,
|
y: rect.top + 26,
|
||||||
h: 26
|
h: 26
|
||||||
});
|
});
|
||||||
|
window.siyuan.menus.menu.element.setAttribute("data-from", hasClosestByClassName(protyle.element, "block__edit") ? "popover" : "app")
|
||||||
const textElements = window.siyuan.menus.menu.element.querySelectorAll("textarea");
|
const textElements = window.siyuan.menus.menu.element.querySelectorAll("textarea");
|
||||||
if (focusText || protyle.lute.IsValidLinkDest(linkAddress)) {
|
if (focusText || protyle.lute.IsValidLinkDest(linkAddress)) {
|
||||||
textElements[1].select();
|
textElements[1].select();
|
||||||
@ -1384,6 +1387,7 @@ export const tagMenu = (protyle: IProtyle, tagElement: HTMLElement) => {
|
|||||||
y: rect.top + 26,
|
y: rect.top + 26,
|
||||||
h: 26
|
h: 26
|
||||||
});
|
});
|
||||||
|
window.siyuan.menus.menu.element.setAttribute("data-from", hasClosestByClassName(protyle.element, "block__edit") ? "popover" : "app")
|
||||||
window.siyuan.menus.menu.element.querySelector("input").select();
|
window.siyuan.menus.menu.element.querySelector("input").select();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user