mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-04 04:02:58 +08:00
🚨
This commit is contained in:
parent
a1c81fda03
commit
4fe7184f81
@ -158,10 +158,10 @@ export const exportConfig = {
|
|||||||
window.location.href = response.data.zip;
|
window.location.href = response.data.zip;
|
||||||
});
|
});
|
||||||
/// #else
|
/// #else
|
||||||
let filePaths = dialog.showOpenDialogSync({
|
const filePaths = dialog.showOpenDialogSync({
|
||||||
title: window.siyuan.languages.export + " " + "Data",
|
title: window.siyuan.languages.export + " " + "Data",
|
||||||
properties: ["createDirectory", "openDirectory"],
|
properties: ["createDirectory", "openDirectory"],
|
||||||
})
|
});
|
||||||
if (filePaths && 0 < filePaths.length) {
|
if (filePaths && 0 < filePaths.length) {
|
||||||
const savePath = filePaths[0];
|
const savePath = filePaths[0];
|
||||||
const msgId = showMessage(window.siyuan.languages.exporting, -1);
|
const msgId = showMessage(window.siyuan.languages.exporting, -1);
|
||||||
|
@ -562,7 +562,7 @@ export class Toolbar {
|
|||||||
this.range.insertNode(currentNewNode);
|
this.range.insertNode(currentNewNode);
|
||||||
// https://github.com/siyuan-note/siyuan/issues/6155
|
// https://github.com/siyuan-note/siyuan/issues/6155
|
||||||
if (currentNewNode.nodeType !== 3 && ["code", "tag", "kbd"].includes(type)) {
|
if (currentNewNode.nodeType !== 3 && ["code", "tag", "kbd"].includes(type)) {
|
||||||
const previousSibling = hasPreviousSibling(currentNewNode)
|
const previousSibling = hasPreviousSibling(currentNewNode);
|
||||||
if (!previousSibling || previousSibling.textContent.endsWith("\n")) {
|
if (!previousSibling || previousSibling.textContent.endsWith("\n")) {
|
||||||
currentNewNode.before(document.createTextNode(Constants.ZWSP));
|
currentNewNode.before(document.createTextNode(Constants.ZWSP));
|
||||||
}
|
}
|
||||||
@ -923,7 +923,7 @@ export class Toolbar {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}, Constants.TIMEOUT_TRANSITION);
|
}, Constants.TIMEOUT_TRANSITION);
|
||||||
}
|
};
|
||||||
headerElement.addEventListener("mousedown", (event: MouseEvent) => {
|
headerElement.addEventListener("mousedown", (event: MouseEvent) => {
|
||||||
if (hasClosestByClassName(event.target as HTMLElement, "block__icon")) {
|
if (hasClosestByClassName(event.target as HTMLElement, "block__icon")) {
|
||||||
return;
|
return;
|
||||||
|
@ -1145,7 +1145,7 @@ const panelTreeKeydown = (event: KeyboardEvent) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (!activePanelElement) {
|
if (!activePanelElement) {
|
||||||
return false
|
return false;
|
||||||
}
|
}
|
||||||
if (activePanelElement.className.indexOf("sy__") === -1) {
|
if (activePanelElement.className.indexOf("sy__") === -1) {
|
||||||
return false;
|
return false;
|
||||||
@ -1175,25 +1175,25 @@ const panelTreeKeydown = (event: KeyboardEvent) => {
|
|||||||
if (!model) {
|
if (!model) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
let activeItemElement = activePanelElement.querySelector(".b3-list-item--focus")
|
let activeItemElement = activePanelElement.querySelector(".b3-list-item--focus");
|
||||||
if (!activeItemElement) {
|
if (!activeItemElement) {
|
||||||
activeItemElement = activePanelElement.querySelector(".b3-list .b3-list-item");
|
activeItemElement = activePanelElement.querySelector(".b3-list .b3-list-item");
|
||||||
if (activeItemElement) {
|
if (activeItemElement) {
|
||||||
activeItemElement.classList.add("b3-list-item--focus")
|
activeItemElement.classList.add("b3-list-item--focus");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let tree = (model as Backlink).tree
|
let tree = (model as Backlink).tree;
|
||||||
if (activeItemElement.parentElement.parentElement.classList.contains("backlinkMList")) {
|
if (activeItemElement.parentElement.parentElement.classList.contains("backlinkMList")) {
|
||||||
tree = (model as Backlink).mTree
|
tree = (model as Backlink).mTree;
|
||||||
}
|
}
|
||||||
if (event.key === "Enter") {
|
if (event.key === "Enter") {
|
||||||
tree.click(activeItemElement);
|
tree.click(activeItemElement);
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
return true;
|
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")) ||
|
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"))) {
|
(event.key === "ArrowLeft" && arrowElement.classList.contains("b3-list-item__arrow--open") && !arrowElement.parentElement.classList.contains("fn__hidden"))) {
|
||||||
tree.toggleBlocks(activeItemElement);
|
tree.toggleBlocks(activeItemElement);
|
||||||
@ -1290,6 +1290,6 @@ const panelTreeKeydown = (event: KeyboardEvent) => {
|
|||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false
|
return false;
|
||||||
}
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user