From 659823011248073adbd8837a23a067bc0f58901c Mon Sep 17 00:00:00 2001 From: Vanessa Date: Thu, 12 Dec 2024 11:12:44 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E5=88=A0=E9=99=A4=E8=B7=A8=E9=A1=B5?= =?UTF-8?q?=E6=B3=A8=E9=87=8A=20https://github.com/siyuan-note/siyuan/issu?= =?UTF-8?q?es/13282?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/asset/anno.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/asset/anno.ts b/app/src/asset/anno.ts index c0f7a721c..72da91296 100644 --- a/app/src/asset/anno.ts +++ b/app/src/asset/anno.ts @@ -197,8 +197,11 @@ export const initAnno = (element: HTMLElement, pdf: any) => { } else if (type === "remove") { const urlPath = pdf.appConfig.file.replace(location.origin, "").substr(1); const config = getConfig(pdf); - delete config[rectElement.getAttribute("data-node-id")]; - rectElement.remove(); + const id = rectElement.getAttribute("data-node-id") + delete config[id]; + element.querySelectorAll(`[data-node-id="${id}"]`).forEach(item => { + item.remove(); + }); fetchPost("/api/asset/setFileAnnotation", { path: urlPath + ".sya", data: JSON.stringify(config),