This commit is contained in:
Vanessa 2023-09-28 23:41:44 +08:00
parent 4c6b695dae
commit 6a37b86613
7 changed files with 14 additions and 16 deletions

View file

@ -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",

View file

@ -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;
}

View file

@ -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";

View file

@ -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;
@ -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, "");

View file

@ -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;

View file

@ -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);
@ -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);

View file

@ -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);
@ -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);