diff --git a/app/src/asset/anno.ts b/app/src/asset/anno.ts index a44c2334b..91a13caaf 100644 --- a/app/src/asset/anno.ts +++ b/app/src/asset/anno.ts @@ -278,7 +278,7 @@ const getRelationHTML = (ids: string[]) => { if (!ids) { return `
  • ${window.siyuan.languages.emptyContent}
  • `; } - let html = "" + let html = ""; ids.forEach((id: string) => { html += `
  • ${id} @@ -286,9 +286,9 @@ const getRelationHTML = (ids: string[]) => {
  • `; - }) - return html -} + }); + return html; +}; const setRelation = (pdf: any) => { const config = getConfig(pdf); @@ -322,25 +322,25 @@ const setRelation = (pdf: any) => { } else { showMessage("ID " + window.siyuan.languages.invalid); } - } + }; const updateRelation = (pdf: any, config: any) => { fetchPost("/api/asset/setFileAnnotation", { path: pdf.appConfig.file.replace(location.origin, "").substr(1) + ".sya", data: JSON.stringify(config), }); - } + }; - const inputElement = dialog.element.querySelector(".b3-text-field") as HTMLInputElement + const inputElement = dialog.element.querySelector(".b3-text-field") as HTMLInputElement; inputElement.focus(); inputElement.addEventListener("keydown", (event) => { if (event.isComposing) { - return + return; } if (event.key === "Enter") { addRelation(); } - }) + }); dialog.element.addEventListener("click", (event) => { let target = event.target as HTMLElement; while (target && !target.classList.contains("b3-dialog__content")) { @@ -359,7 +359,7 @@ const setRelation = (pdf: any) => { target = target.parentElement; } }); -} +}; const hideToolbar = (element: HTMLElement) => { element.querySelector(".pdf__util").classList.add("fn__none"); @@ -656,7 +656,7 @@ const showHighlight = (selected: IPdfAnno, pdf: any, hl?: boolean) => { textLayerElement.insertAdjacentHTML("beforeend", "
    "); } textLayerElement = textLayerElement.lastElementChild; - let html = `
    `; + let html = `
    `; selected.coords.forEach((rect) => { const bounds = viewport.convertToViewportRectangle(rect); const width = Math.abs(bounds[0] - bounds[2]); diff --git a/app/src/block/popover.ts b/app/src/block/popover.ts index 2940b92fc..424b3a256 100644 --- a/app/src/block/popover.ts +++ b/app/src/block/popover.ts @@ -278,7 +278,7 @@ export const showPopover = async (app: App, showRef = false) => { // 编辑器中的引用数 targetId = popoverTargetElement.parentElement.parentElement.getAttribute("data-node-id"); } else if (popoverTargetElement.classList.contains("pdf__rect")) { - const relationIds = popoverTargetElement.getAttribute("data-relations") + const relationIds = popoverTargetElement.getAttribute("data-relations"); if (relationIds) { ids = relationIds.split(","); url = "";