mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-19 10:30:45 +08:00
🐛 goback
This commit is contained in:
parent
8aead228d4
commit
a3c0fecec8
@ -123,7 +123,6 @@ export const goForward = () => {
|
|||||||
|
|
||||||
export const goBack = () => {
|
export const goBack = () => {
|
||||||
const editor = getCurrentEditor();
|
const editor = getCurrentEditor();
|
||||||
const protyle = editor.protyle;
|
|
||||||
if (window.siyuan.menus.menu.element.classList.contains("b3-menu--fullscreen") &&
|
if (window.siyuan.menus.menu.element.classList.contains("b3-menu--fullscreen") &&
|
||||||
!window.siyuan.menus.menu.element.classList.contains("fn__none")) {
|
!window.siyuan.menus.menu.element.classList.contains("fn__none")) {
|
||||||
window.siyuan.menus.menu.element.dispatchEvent(new CustomEvent("click", {detail: "back"}));
|
window.siyuan.menus.menu.element.dispatchEvent(new CustomEvent("click", {detail: "back"}));
|
||||||
@ -139,7 +138,7 @@ export const goBack = () => {
|
|||||||
closePanel();
|
closePanel();
|
||||||
return;
|
return;
|
||||||
} else if (editor && !editor.protyle.toolbar.subElement.classList.contains("fn__none")) {
|
} else if (editor && !editor.protyle.toolbar.subElement.classList.contains("fn__none")) {
|
||||||
hideElements(["util"], protyle);
|
hideElements(["util"], editor.protyle);
|
||||||
closePanel();
|
closePanel();
|
||||||
return;
|
return;
|
||||||
} else if (window.siyuan.dialogs.length !== 0) {
|
} else if (window.siyuan.dialogs.length !== 0) {
|
||||||
@ -158,7 +157,8 @@ export const goBack = () => {
|
|||||||
if (window.siyuan.backStack.length < 1) {
|
if (window.siyuan.backStack.length < 1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (forwardStack.length === 0) {
|
if (forwardStack.length === 0 && editor) {
|
||||||
|
const protyle = editor.protyle;
|
||||||
forwardStack.push({
|
forwardStack.push({
|
||||||
id: protyle.block.showAll ? protyle.block.id : protyle.block.rootID,
|
id: protyle.block.showAll ? protyle.block.id : protyle.block.rootID,
|
||||||
endId: protyle.wysiwyg.element.firstElementChild.getAttribute("data-node-id") + Constants.ZWSP + protyle.wysiwyg.element.lastElementChild.getAttribute("data-node-id"),
|
endId: protyle.wysiwyg.element.firstElementChild.getAttribute("data-node-id") + Constants.ZWSP + protyle.wysiwyg.element.lastElementChild.getAttribute("data-node-id"),
|
||||||
|
Loading…
Reference in New Issue
Block a user