This commit is contained in:
Vanessa 2022-12-07 22:52:41 +08:00
parent a1c81fda03
commit 4fe7184f81
3 changed files with 12 additions and 12 deletions

View File

@ -158,10 +158,10 @@ export const exportConfig = {
window.location.href = response.data.zip;
});
/// #else
let filePaths = dialog.showOpenDialogSync({
const filePaths = dialog.showOpenDialogSync({
title: window.siyuan.languages.export + " " + "Data",
properties: ["createDirectory", "openDirectory"],
})
});
if (filePaths && 0 < filePaths.length) {
const savePath = filePaths[0];
const msgId = showMessage(window.siyuan.languages.exporting, -1);

View File

@ -562,7 +562,7 @@ export class Toolbar {
this.range.insertNode(currentNewNode);
// https://github.com/siyuan-note/siyuan/issues/6155
if (currentNewNode.nodeType !== 3 && ["code", "tag", "kbd"].includes(type)) {
const previousSibling = hasPreviousSibling(currentNewNode)
const previousSibling = hasPreviousSibling(currentNewNode);
if (!previousSibling || previousSibling.textContent.endsWith("\n")) {
currentNewNode.before(document.createTextNode(Constants.ZWSP));
}
@ -923,7 +923,7 @@ export class Toolbar {
});
});
}, Constants.TIMEOUT_TRANSITION);
}
};
headerElement.addEventListener("mousedown", (event: MouseEvent) => {
if (hasClosestByClassName(event.target as HTMLElement, "block__icon")) {
return;

View File

@ -1145,7 +1145,7 @@ const panelTreeKeydown = (event: KeyboardEvent) => {
});
}
if (!activePanelElement) {
return false
return false;
}
if (activePanelElement.className.indexOf("sy__") === -1) {
return false;
@ -1175,25 +1175,25 @@ const panelTreeKeydown = (event: KeyboardEvent) => {
if (!model) {
return false;
}
let activeItemElement = activePanelElement.querySelector(".b3-list-item--focus")
let activeItemElement = activePanelElement.querySelector(".b3-list-item--focus");
if (!activeItemElement) {
activeItemElement = activePanelElement.querySelector(".b3-list .b3-list-item");
if (activeItemElement) {
activeItemElement.classList.add("b3-list-item--focus")
activeItemElement.classList.add("b3-list-item--focus");
}
return false;
}
let tree = (model as Backlink).tree
let tree = (model as Backlink).tree;
if (activeItemElement.parentElement.parentElement.classList.contains("backlinkMList")) {
tree = (model as Backlink).mTree
tree = (model as Backlink).mTree;
}
if (event.key === "Enter") {
tree.click(activeItemElement);
event.preventDefault();
return true;
}
const arrowElement = activeItemElement.querySelector(".b3-list-item__arrow")
const arrowElement = activeItemElement.querySelector(".b3-list-item__arrow");
if ((event.key === "ArrowRight" && !arrowElement.classList.contains("b3-list-item__arrow--open") && !arrowElement.parentElement.classList.contains("fn__hidden")) ||
(event.key === "ArrowLeft" && arrowElement.classList.contains("b3-list-item__arrow--open") && !arrowElement.parentElement.classList.contains("fn__hidden"))) {
tree.toggleBlocks(activeItemElement);
@ -1290,6 +1290,6 @@ const panelTreeKeydown = (event: KeyboardEvent) => {
event.preventDefault();
return true;
}
return false
}
return false;
};