Skip to content

Commit

Permalink
🚨
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Sep 28, 2023
1 parent 4c6b695 commit 6a37b86
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 16 deletions.
8 changes: 4 additions & 4 deletions app/src/boot/globalEvent/keydown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -429,13 +429,13 @@ const fileTreeKeydown = (app: App, event: KeyboardEvent) => {
}

if (matchHotKey(window.siyuan.config.keymap.editor.general.quickMakeCard.custom, event)) {
const blockIDs: string[] = []
const blockIDs: string[] = [];
liElements.forEach(item => {
const id = item.getAttribute("data-node-id")
const id = item.getAttribute("data-node-id");
if (id) {
blockIDs.push(id)
blockIDs.push(id);
}
})
});
if (blockIDs.length > 0) {
transaction(undefined, [{
action: "addFlashcards",
Expand Down
8 changes: 4 additions & 4 deletions app/src/menus/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ const initMultiMenu = (selectItemElements: NodeListOf<Element>, app: App) => {
}
}).element);

const blockIDs: string[] = []
const blockIDs: string[] = [];
selectItemElements.forEach(item => {
const id = item.getAttribute("data-node-id")
const id = item.getAttribute("data-node-id");
if (id) {
blockIDs.push(id)
blockIDs.push(id);
}
})
});
if (blockIDs.length === 0) {
return window.siyuan.menus.menu;
}
Expand Down
1 change: 0 additions & 1 deletion app/src/protyle/header/Title.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import {code160to32} from "../util/code160to32";
import {genEmptyElement} from "../../block/util";
import {transaction} from "../wysiwyg/transaction";
import {hideTooltip} from "../../dialog/tooltip";
import {quickMakeCard} from "../../card/makeCard";
import {commonClick} from "../wysiwyg/commonClick";
import {openTitleMenu} from "./openTitleMenu";

Expand Down
3 changes: 1 addition & 2 deletions app/src/protyle/hint/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import {isMobile} from "../../util/functions";
import {isCtrl, isIPhone} from "../util/compatibility";
import {avRender} from "../render/av/render";
import {genIconHTML} from "../render/util";
import {insertAttrViewBlockAnimation} from "../render/av/action";

export class Hint {
public timeId: number;
Expand Down Expand Up @@ -415,7 +414,7 @@ ${genHintItemHTML(item)}
if (!cellElement) {
return;
}
const previousID = cellElement.dataset.blockId
const previousID = cellElement.dataset.blockId;
const avID = nodeElement.getAttribute("data-av-id");
let tempElement = document.createElement("div");
tempElement.innerHTML = value.replace(/<mark>/g, "").replace(/<\/mark>/g, "");
Expand Down
2 changes: 1 addition & 1 deletion app/src/protyle/render/av/cell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ const updateCellValue = (protyle: IProtyle, type: TAVCol, cellElements: HTMLElem
if (!document.contains(cellElements[0]) && cellElements.length === 1 && cellElements[0].dataset.detached === "true") {
// 新增行后弹出的输入框进行修改后,原始 cell 已被更新
const avid = cellElements[0].parentElement.dataset.avid;
cellElements[0] = protyle.wysiwyg.element.querySelector(`[data-av-id="${avid}"] .av__row--add`).previousElementSibling.querySelector('[data-detached="true"]')
cellElements[0] = protyle.wysiwyg.element.querySelector(`[data-av-id="${avid}"] .av__row--add`).previousElementSibling.querySelector('[data-detached="true"]');
}
if (cellElements.length === 1 && cellElements[0].dataset.detached === "true" && !cellElements[0].parentElement.dataset.id) {
return;
Expand Down
4 changes: 2 additions & 2 deletions app/src/search/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export const openSearchAsset = (element: Element, isStick: boolean) => {
renderPreview(previewElement, currentList.dataset.id, searchInputElement.value, localSearch.method);
} else if (Constants.KEYCODELIST[event.keyCode] === "PageUp") {
if (!element.querySelector('[data-type="assetPrevious"]').getAttribute("disabled")) {
let currentPage = parseInt(element.querySelector("#searchAssetResult .fn__flex-center").textContent.split("/")[0])
let currentPage = parseInt(element.querySelector("#searchAssetResult .fn__flex-center").textContent.split("/")[0]);
if (currentPage > 1) {
currentPage--;
assetInputEvent(element, localSearch, currentPage);
Expand All @@ -203,7 +203,7 @@ export const openSearchAsset = (element: Element, isStick: boolean) => {
event.preventDefault();
} else if (Constants.KEYCODELIST[event.keyCode] === "PageDown") {
if (!element.querySelector('[data-type="assetNext"]').getAttribute("disabled")) {
let currentPage = parseInt(element.querySelector("#searchAssetResult .fn__flex-center").textContent.split("/")[0])
let currentPage = parseInt(element.querySelector("#searchAssetResult .fn__flex-center").textContent.split("/")[0]);
if (currentPage < parseInt(element.querySelector("#searchAssetResult .fn__flex-center").textContent.split("/")[1])) {
currentPage++;
assetInputEvent(element, localSearch, currentPage);
Expand Down
4 changes: 2 additions & 2 deletions app/src/search/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, clo
break;
} else if (type === "assetPrevious") {
if (!target.getAttribute("disabled")) {
let currentPage = parseInt(assetsElement.querySelector("#searchAssetResult .fn__flex-center").textContent.split("/")[0])
let currentPage = parseInt(assetsElement.querySelector("#searchAssetResult .fn__flex-center").textContent.split("/")[0]);
if (currentPage > 1) {
currentPage--;
assetInputEvent(assetsElement, localSearch, currentPage);
Expand All @@ -660,7 +660,7 @@ export const genSearch = (app: App, config: ISearchOption, element: Element, clo
break;
} else if (type === "assetNext") {
if (!target.getAttribute("disabled")) {
let currentPage = parseInt(assetsElement.querySelector("#searchAssetResult .fn__flex-center").textContent.split("/")[0])
let currentPage = parseInt(assetsElement.querySelector("#searchAssetResult .fn__flex-center").textContent.split("/")[0]);
if (currentPage < parseInt(assetsElement.querySelector("#searchAssetResult .fn__flex-center").textContent.split("/")[1])) {
currentPage++;
assetInputEvent(assetsElement, localSearch, currentPage);
Expand Down

0 comments on commit 6a37b86

Please sign in to comment.