diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts index 30e79e86a..3285ed9d5 100644 --- a/app/src/protyle/wysiwyg/index.ts +++ b/app/src/protyle/wysiwyg/index.ts @@ -1123,7 +1123,7 @@ export class WYSIWYG { } const ids: string[] = []; - const selectElement = protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select") + const selectElement = protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select"); selectElement.forEach(item => { ids.push(item.getAttribute("data-node-id")); }); diff --git a/app/src/util/globalShortcut.ts b/app/src/util/globalShortcut.ts index 1843d5ea8..058c9df7a 100644 --- a/app/src/util/globalShortcut.ts +++ b/app/src/util/globalShortcut.ts @@ -158,41 +158,41 @@ export const globalShortcut = () => { } }); - let switchDialog: Dialog + let switchDialog: Dialog; window.addEventListener("keyup", (event) => { window.siyuan.ctrlIsPressed = false; window.siyuan.shiftIsPressed = false; window.siyuan.altIsPressed = false; if (switchDialog && switchDialog.element.parentElement) { if (event.key === "Tab") { - const currentLiElement = switchDialog.element.querySelector(".b3-list-item--focus") - currentLiElement.classList.remove("b3-list-item--focus") + const currentLiElement = switchDialog.element.querySelector(".b3-list-item--focus"); + currentLiElement.classList.remove("b3-list-item--focus"); if (event.shiftKey) { if (currentLiElement.previousElementSibling) { - currentLiElement.previousElementSibling.classList.add("b3-list-item--focus") + currentLiElement.previousElementSibling.classList.add("b3-list-item--focus"); } else if (currentLiElement.getAttribute("data-original")) { - currentLiElement.parentElement.lastElementChild.classList.add("b3-list-item--focus") - currentLiElement.removeAttribute("data-original") + currentLiElement.parentElement.lastElementChild.classList.add("b3-list-item--focus"); + currentLiElement.removeAttribute("data-original"); } else if (currentLiElement.parentElement.nextElementSibling) { - currentLiElement.parentElement.nextElementSibling.lastElementChild.classList.add("b3-list-item--focus") + currentLiElement.parentElement.nextElementSibling.lastElementChild.classList.add("b3-list-item--focus"); } else if (currentLiElement.parentElement.previousElementSibling) { - currentLiElement.parentElement.previousElementSibling.lastElementChild.classList.add("b3-list-item--focus") + currentLiElement.parentElement.previousElementSibling.lastElementChild.classList.add("b3-list-item--focus"); } } else { if (currentLiElement.nextElementSibling) { - currentLiElement.nextElementSibling.classList.add("b3-list-item--focus") + currentLiElement.nextElementSibling.classList.add("b3-list-item--focus"); } else if (currentLiElement.getAttribute("data-original")) { - currentLiElement.parentElement.firstElementChild.classList.add("b3-list-item--focus") - currentLiElement.removeAttribute("data-original") + currentLiElement.parentElement.firstElementChild.classList.add("b3-list-item--focus"); + currentLiElement.removeAttribute("data-original"); } else if (currentLiElement.parentElement.nextElementSibling) { - currentLiElement.parentElement.nextElementSibling.firstElementChild.classList.add("b3-list-item--focus") + currentLiElement.parentElement.nextElementSibling.firstElementChild.classList.add("b3-list-item--focus"); } else if (currentLiElement.parentElement.previousElementSibling) { - currentLiElement.parentElement.previousElementSibling.firstElementChild.classList.add("b3-list-item--focus") + currentLiElement.parentElement.previousElementSibling.firstElementChild.classList.add("b3-list-item--focus"); } } } else if (event.key === "Control") { - const currentLiElement = switchDialog.element.querySelector(".b3-list-item--focus") - const currentType = currentLiElement.getAttribute("data-type") as TDockType + const currentLiElement = switchDialog.element.querySelector(".b3-list-item--focus"); + const currentType = currentLiElement.getAttribute("data-type") as TDockType; if (currentType) { getDockByType(currentType).toggleModel(currentType, true); const target = event.target as HTMLElement; @@ -202,14 +202,14 @@ export const globalShortcut = () => { target.blur(); } } else { - const currentId = currentLiElement.getAttribute("data-id") + const currentId = currentLiElement.getAttribute("data-id"); getAllTabs().find(item => { if (item.id === currentId) { item.parent.switchTab(item.headElement); setPanelFocus(item.headElement.parentElement.parentElement); return true; } - }) + }); } switchDialog.destroy(); switchDialog = undefined; @@ -254,29 +254,29 @@ export const globalShortcut = () => { if (switchDialog && switchDialog.element.parentElement) { return; } - let dockHtml = '' - let tabHtml = '' + let dockHtml = ""; + let tabHtml = ""; getAllDocks().forEach(item => { dockHtml += `