🎨 菜单右键复制无效

This commit is contained in:
Vanessa 2024-01-23 16:03:28 +08:00
parent 802c58df46
commit e44c402aa4
4 changed files with 12 additions and 35 deletions

View file

@ -22,14 +22,11 @@ export const abcRender = (element: Element, cdn = Constants.PROTYLE_CDN) => {
if(!e.firstElementChild.classList.contains("protyle-icons")) {
e.insertAdjacentHTML("afterbegin", genIconHTML());
}
if (e.childElementCount < 4) {
e.lastElementChild.insertAdjacentHTML("beforebegin", `<span style="position: absolute">${Constants.ZWSP}</span>`);
}
const renderElement = e.firstElementChild.nextElementSibling as HTMLElement;
window.ABCJS.renderAbc(renderElement, Lute.UnEscapeHTMLStr(e.getAttribute("data-content")), {
renderElement.innerHTML = `<span style="position: absolute;left:0;top:0;width: 1px;">${Constants.ZWSP}</span><div contenteditable="false"></div>`;
window.ABCJS.renderAbc(renderElement.lastElementChild, Lute.UnEscapeHTMLStr(e.getAttribute("data-content")), {
responsive: "resize"
});
renderElement.setAttribute("contenteditable", "false");
e.setAttribute("data-render", "true");
});
});