diff --git a/app/src/card/openCard.ts b/app/src/card/openCard.ts index c44205e53..00ac0ed35 100644 --- a/app/src/card/openCard.ts +++ b/app/src/card/openCard.ts @@ -312,7 +312,7 @@ export const bindCardEvent = async (options: { fetchPost("/api/riff/batchSetRiffCardsDueTime", { cardDues: [{ id: currentCard.cardID, - due: dayjs().add(parseInt(inputElement.value), 'day').format("YYYYMMDDHHmmss") + due: dayjs().add(parseInt(inputElement.value), "day").format("YYYYMMDDHHmmss") }] }, () => { actionElements[0].classList.add("fn__none"); diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.ts index 4a373a833..cc4a506fd 100644 --- a/app/src/protyle/render/av/cell.ts +++ b/app/src/protyle/render/av/cell.ts @@ -309,9 +309,9 @@ export const cellScrollIntoView = (blockElement: HTMLElement, cellElement: Eleme /// #if MOBILE const contentElement = hasClosestByClassName(blockElement, "protyle-content", true); if (contentElement && cellElement.getAttribute("data-dtype") !== "checkbox") { - const keyboardToolbarElement = document.getElementById("keyboardToolbar") - const keyboardH = parseInt(keyboardToolbarElement.getAttribute("data-keyboardheight")) || (window.outerHeight / 2 - 42) - console.log(keyboardH, window.innerHeight, cellRect.bottom) + const keyboardToolbarElement = document.getElementById("keyboardToolbar"); + const keyboardH = parseInt(keyboardToolbarElement.getAttribute("data-keyboardheight")) || (window.outerHeight / 2 - 42); + console.log(keyboardH, window.innerHeight, cellRect.bottom); if (cellRect.bottom > window.innerHeight - keyboardH - 42) { contentElement.scrollTop += cellRect.bottom - window.innerHeight + 42 + keyboardH; } else if (cellRect.top < 110) { diff --git a/app/src/protyle/render/av/view.ts b/app/src/protyle/render/av/view.ts index e4d2e2d98..aa3c1a435 100644 --- a/app/src/protyle/render/av/view.ts +++ b/app/src/protyle/render/av/view.ts @@ -219,20 +219,20 @@ export const bindSwitcherEvent = (options: { protyle: IProtyle, menuElement: Ele if (event.isComposing) { return; } - upDownHint(options.menuElement.querySelector('.fn__flex-1'), event, "b3-menu__item--current"); + upDownHint(options.menuElement.querySelector(".fn__flex-1"), event, "b3-menu__item--current"); if (event.key === "Enter") { const currentElement = options.menuElement.querySelector(".b3-menu__item--current") as HTMLElement; if (currentElement) { options.blockElement.removeAttribute("data-render"); avRender(options.blockElement, options.protyle, undefined, currentElement.dataset.id); options.menuElement.remove(); - focusBlock(options.blockElement) + focusBlock(options.blockElement); } } else if (event.key === "Escape") { options.menuElement.remove(); - focusBlock(options.blockElement) + focusBlock(options.blockElement); } - }) + }); inputElement.addEventListener("input", (event: InputEvent) => { if (event.isComposing) { return; @@ -242,7 +242,7 @@ export const bindSwitcherEvent = (options: { protyle: IProtyle, menuElement: Ele inputElement.addEventListener("compositionend", () => { filterSwitcher(options.menuElement); }); -} +}; const filterSwitcher = (menuElement: Element) => { const inputElement = menuElement.querySelector(".b3-text-field") as HTMLInputElement; @@ -251,16 +251,16 @@ const filterSwitcher = (menuElement: Element) => { if (!key || (key.toLowerCase().indexOf(item.textContent.trim().toLowerCase()) > -1 || item.textContent.trim().toLowerCase().indexOf(key.toLowerCase()) > -1)) { - item.classList.remove("fn__none") + item.classList.remove("fn__none"); } else { - item.classList.add("fn__none") - item.classList.remove("b3-menu__item--current") + item.classList.add("fn__none"); + item.classList.remove("b3-menu__item--current"); } - }) - if (!menuElement.querySelector('.b3-menu__item--current')) { - menuElement.querySelector(".fn__flex-1 .b3-menu__item:not(.fn__none)")?.classList.add("b3-menu__item--current") + }); + if (!menuElement.querySelector(".b3-menu__item--current")) { + menuElement.querySelector(".fn__flex-1 .b3-menu__item:not(.fn__none)")?.classList.add("b3-menu__item--current"); } -} +}; export const getSwitcherHTML = (views: IAVView[], viewId: string) => { let html = ""; diff --git a/app/src/protyle/wysiwyg/transaction.ts b/app/src/protyle/wysiwyg/transaction.ts index a574a4a08..df6b0d23a 100644 --- a/app/src/protyle/wysiwyg/transaction.ts +++ b/app/src/protyle/wysiwyg/transaction.ts @@ -352,7 +352,7 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo: if (isUndo) { return; } - const embedElement = isInEmbedBlock(item) + const embedElement = isInEmbedBlock(item); if (embedElement) { embedElement.removeAttribute("data-render"); blockRender(protyle, embedElement); @@ -1192,7 +1192,7 @@ const processFold = (operation: IOperation, protyle: IProtyle) => { if (operation.action === "unfoldHeading") { const scrollTop = protyle.contentElement.scrollTop; protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${operation.id}"]`).forEach(item => { - const embedElement = isInEmbedBlock(item) + const embedElement = isInEmbedBlock(item); if (embedElement) { embedElement.removeAttribute("data-render"); blockRender(protyle, embedElement); @@ -1224,7 +1224,7 @@ const processFold = (operation: IOperation, protyle: IProtyle) => { return; } protyle.wysiwyg.element.querySelectorAll(`[data-node-id="${operation.id}"]`).forEach(item => { - const embedElement = isInEmbedBlock(item) + const embedElement = isInEmbedBlock(item); if (embedElement) { embedElement.removeAttribute("data-render"); blockRender(protyle, embedElement);