This commit is contained in:
Vanessa 2023-04-06 20:32:40 +08:00
parent 053c4864a1
commit 4b542c9ff2
2 changed files with 11 additions and 9 deletions

View file

@ -335,14 +335,6 @@ export class Breadcrumb {
accelerator: window.siyuan.config.keymap.editor.general.wysiwyg.custom,
click: () => {
setEditMode(protyle, "wysiwyg");
protyle.scroll.lastScrollTop = 0;
fetchPost("/api/filetree/getDoc", {
id: protyle.block.rootID,
size: window.siyuan.config.editor.dynamicLoadBlocks,
}, getResponse => {
onGet(getResponse, protyle);
window.siyuan.menus.menu.remove();
});
}
}];
editSubmenu.push({

View file

@ -11,6 +11,11 @@ export const setEditMode = (protyle: IProtyle, type: TEditorMode) => {
protyle.scroll?.element.classList.add("fn__none");
if (protyle.options.render.breadcrumb) {
protyle.breadcrumb?.element.classList.add("fn__none");
if (protyle.block.showAll) {
const exitFocusElement = protyle.breadcrumb.element.parentElement.querySelector('[data-type="exit-focus"]')
exitFocusElement.classList.add("fn__none");
exitFocusElement.nextElementSibling.classList.add("fn__none");
}
}
protyle.preview.render(protyle);
} else if (type === "wysiwyg") {
@ -26,7 +31,12 @@ export const setEditMode = (protyle: IProtyle, type: TEditorMode) => {
}
if (protyle.options.render.breadcrumb) {
protyle.breadcrumb?.element.classList.remove("fn__none");
if (protyle.block.showAll) {
const exitFocusElement = protyle.breadcrumb.element.parentElement.querySelector('[data-type="exit-focus"]')
exitFocusElement.classList.remove("fn__none");
exitFocusElement.nextElementSibling.classList.remove("fn__none");
}
}
}
hideElements( ["gutter", "toolbar", "select", "hint", "util"], protyle);
hideElements(["gutter", "toolbar", "select", "hint", "util"], protyle);
};