From 186e6c8b0a49f3365ab90374a8f211c2e26cb31f Mon Sep 17 00:00:00 2001 From: Vanessa Date: Wed, 29 Nov 2023 10:38:54 +0800 Subject: [PATCH] :rotating_light: --- app/src/layout/dock/Inbox.ts | 30 +++++++++++++++--------------- app/src/protyle/util/onGet.ts | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/app/src/layout/dock/Inbox.ts b/app/src/layout/dock/Inbox.ts index b38f2485a..b5fae5a2d 100644 --- a/app/src/layout/dock/Inbox.ts +++ b/app/src/layout/dock/Inbox.ts @@ -80,11 +80,11 @@ export class Inbox extends Model { const detailsElement = this.element.querySelector(".inboxDetails"); const selectAllElement = this.element.firstElementChild.querySelector('[data-type="selectall"]'); this.element.lastElementChild.addEventListener("contextmenu", (event: MouseEvent) => { - const itemElement = hasClosestByClassName(event.target as Element, "b3-list-item") + const itemElement = hasClosestByClassName(event.target as Element, "b3-list-item"); if (itemElement) { this.more(event, itemElement); } - }) + }); this.element.addEventListener("click", (event: MouseEvent) => { /// #if !MOBILE setPanelFocus(this.element); @@ -101,34 +101,34 @@ export class Inbox extends Model { event.preventDefault(); break; } else if (type === "selectall") { - const useElement = target.querySelector("use") + const useElement = target.querySelector("use"); if (useElement.getAttribute("xlink:href") === "#iconUncheck") { this.element.lastElementChild.querySelectorAll(".b3-list-item").forEach(item => { - item.querySelector("use").setAttribute("xlink:href", "#iconCheck") + item.querySelector("use").setAttribute("xlink:href", "#iconCheck"); this.selectIds.push(item.getAttribute("data-id")); this.selectIds = [...new Set(this.selectIds)]; }); - useElement.setAttribute("xlink:href", "#iconCheck") + useElement.setAttribute("xlink:href", "#iconCheck"); } else { this.element.lastElementChild.querySelectorAll(".b3-list-item").forEach(item => { - item.querySelector("use").setAttribute("xlink:href", "#iconUncheck") + item.querySelector("use").setAttribute("xlink:href", "#iconUncheck"); this.selectIds.splice(this.selectIds.indexOf(item.getAttribute("data-id")), 1); }); - useElement.setAttribute("xlink:href", "#iconUncheck") + useElement.setAttribute("xlink:href", "#iconUncheck"); } countElement.innerHTML = `${this.selectIds.length.toString()}/${this.pageCount.toString()}`; window.siyuan.menus.menu.remove(); event.stopPropagation(); break; } else if (type === "select") { - const useElement = target.querySelector("use") + const useElement = target.querySelector("use"); if (useElement.getAttribute("xlink:href") === "#iconUncheck") { this.selectIds.push(target.parentElement.getAttribute("data-id")); this.selectIds = [...new Set(this.selectIds)]; - useElement.setAttribute("xlink:href", "#iconCheck") + useElement.setAttribute("xlink:href", "#iconCheck"); } else { this.selectIds.splice(this.selectIds.indexOf(target.parentElement.getAttribute("data-id")), 1); - useElement.setAttribute("xlink:href", "#iconUncheck") + useElement.setAttribute("xlink:href", "#iconUncheck"); } countElement.innerHTML = `${this.selectIds.length.toString()}/${this.pageCount.toString()}`; selectAllElement.querySelector("use").setAttribute("xlink:href", this.element.lastElementChild.querySelectorAll('[*|href="#iconCheck"]').length === this.element.lastElementChild.querySelectorAll(".b3-list-item").length ? "#iconCheck" : "#iconUncheck"); @@ -227,7 +227,7 @@ ${(Lute.New()).MarkdownStr("", data.shorthandContent)} ${item.shorthandTitle} ${item.hCreated} -` +`; } private more(event: MouseEvent, itemElement?: HTMLElement) { @@ -278,10 +278,10 @@ ${(Lute.New()).MarkdownStr("", data.shorthandContent)} label: window.siyuan.languages.remove, icon: "iconTrashcan", click: () => { - let removeTitle = "" + let removeTitle = ""; ids.forEach((id, index) => { - removeTitle += '' + escapeHtml(this.data[id].shorthandTitle) + "" + (index === ids.length - 1 ? "" : ", ") - }) + removeTitle += '' + escapeHtml(this.data[id].shorthandTitle) + "" + (index === ids.length - 1 ? "" : ", "); + }); confirmDialog(window.siyuan.languages.deleteOpConfirm, `${window.siyuan.languages.confirmDelete} ${removeTitle}?`, () => { if (itemElement) { this.remove(itemElement.dataset.id); @@ -336,7 +336,7 @@ ${(Lute.New()).MarkdownStr("", data.shorthandContent)} }, () => { this.remove(item); }); - }) + }); }); }); diff --git a/app/src/protyle/util/onGet.ts b/app/src/protyle/util/onGet.ts index b8fc3eef0..42d9e7e74 100644 --- a/app/src/protyle/util/onGet.ts +++ b/app/src/protyle/util/onGet.ts @@ -414,4 +414,4 @@ export const setReadonlyByConfig = (protyle: IProtyle) => { } else { enableProtyle(protyle); } -} +};