mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 17:10:12 +01:00
This commit is contained in:
parent
8ff299c1eb
commit
47c83388af
2 changed files with 6 additions and 4 deletions
|
|
@ -245,8 +245,10 @@ export const openFileAttr = (attrs: IObject, focusName = "bookmark", protyle?: I
|
|||
</div>`,
|
||||
destroyCallback() {
|
||||
focusByRange(range);
|
||||
if (protyle) {
|
||||
hideElements(["select"], protyle);
|
||||
}
|
||||
}
|
||||
});
|
||||
dialog.element.setAttribute("data-key", Constants.DIALOG_ATTR);
|
||||
(dialog.element.querySelector('.b3-text-field[data-name="bookmark"]') as HTMLInputElement).value = attrs.bookmark || "";
|
||||
|
|
@ -264,7 +266,7 @@ export const openFileAttr = (attrs: IObject, focusName = "bookmark", protyle?: I
|
|||
target.classList.add("item--focus");
|
||||
dialog.element.querySelectorAll(".custom-attr").forEach((item: HTMLElement) => {
|
||||
if (item.dataset.type === target.dataset.type) {
|
||||
if (item.dataset.type === "NodeAttributeView" && item.innerHTML === "") {
|
||||
if (item.dataset.type === "NodeAttributeView" && item.innerHTML === "" && protyle) {
|
||||
renderAVAttribute(item, attrs.id, protyle);
|
||||
}
|
||||
item.classList.remove("fn__none");
|
||||
|
|
|
|||
|
|
@ -32,16 +32,16 @@ export const chartRender = (element: Element, cdn = Constants.PROTYLE_CDN) => {
|
|||
}
|
||||
const renderElement = e.firstElementChild.nextElementSibling as HTMLElement;
|
||||
try {
|
||||
window.echarts.dispose(renderElement);
|
||||
renderElement.classList.remove("ft__error");
|
||||
renderElement.style.height = e.style.height;
|
||||
const option = await looseJsonParse(Lute.UnEscapeHTMLStr(e.getAttribute("data-content")));
|
||||
window.echarts.init(renderElement, window.siyuan.config.appearance.mode === 1 ? "dark" : undefined, {width}).setOption(option);
|
||||
e.setAttribute("data-render", "true");
|
||||
renderElement.classList.remove("ft__error");
|
||||
if (!renderElement.textContent.endsWith(Constants.ZWSP)) {
|
||||
renderElement.firstElementChild.insertAdjacentText("beforeend", Constants.ZWSP);
|
||||
}
|
||||
} catch (error) {
|
||||
window.echarts.dispose(renderElement);
|
||||
renderElement.classList.add("ft__error");
|
||||
renderElement.innerHTML = `echarts render error: <br>${error}`;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue