mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-15 00:21:00 +08:00
⚡ breadcrumb
This commit is contained in:
parent
f608da26a5
commit
1f2faecf4d
@ -181,7 +181,6 @@ const editKeydown = (app: App, event: KeyboardEvent) => {
|
||||
return false;
|
||||
}
|
||||
} else if (!protyle) {
|
||||
const models = getAllModels();
|
||||
if (!protyle && range) {
|
||||
window.siyuan.blockPanels.find(item => {
|
||||
item.editors.find(editorItem => {
|
||||
@ -195,6 +194,7 @@ const editKeydown = (app: App, event: KeyboardEvent) => {
|
||||
}
|
||||
});
|
||||
}
|
||||
const models = getAllModels();
|
||||
if (!protyle) {
|
||||
models.backlink.find(item => {
|
||||
if (item.element.classList.contains("layout__tab--active")) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {getAllModels} from "../../layout/getAll";
|
||||
import {getAllEditor, getAllModels} from "../../layout/getAll";
|
||||
import {isWindow} from "../../util/functions";
|
||||
import {hasClosestBlock, hasClosestByClassName, hasClosestByMatchTag} from "../../protyle/util/hasClosest";
|
||||
import {getColIndex} from "../../protyle/util/table";
|
||||
@ -36,12 +36,12 @@ export const windowMouseMove = (event: MouseEvent & { target: HTMLElement }, mou
|
||||
coordinates.screenY = event.screenY;
|
||||
|
||||
if (window.siyuan.hideBreadcrumb) {
|
||||
document.querySelectorAll(".protyle-breadcrumb__bar--hide").forEach(item => {
|
||||
item.classList.remove("protyle-breadcrumb__bar--hide");
|
||||
});
|
||||
window.siyuan.hideBreadcrumb = false;
|
||||
getAllModels().editor.forEach(item => {
|
||||
item.editor.protyle.breadcrumb.render(item.editor.protyle, true);
|
||||
getAllEditor().forEach(item => {
|
||||
if (item.protyle.breadcrumb.element.classList.contains("protyle-breadcrumb__bar--hide")) {
|
||||
item.protyle.breadcrumb.element.classList.remove("protyle-breadcrumb__bar--hide");
|
||||
item.protyle.breadcrumb.render(item.protyle, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
if (!mouseIsEnter &&
|
||||
|
@ -10,6 +10,39 @@ import {Files} from "./dock/Files";
|
||||
import {Bookmark} from "./dock/Bookmark";
|
||||
import {Tag} from "./dock/Tag";
|
||||
import {Custom} from "./dock/Custom";
|
||||
import {Protyle} from "../protyle";
|
||||
|
||||
export const getAllEditor = () => {
|
||||
const models = getAllModels();
|
||||
const editors: Protyle[] = [];
|
||||
models.editor.forEach(item => {
|
||||
editors.push(item.editor)
|
||||
})
|
||||
models.search.forEach(item => {
|
||||
editors.push(item.edit)
|
||||
})
|
||||
models.custom.forEach(item => {
|
||||
if (item.data?.editor instanceof Protyle) {
|
||||
editors.push(item.data.editor)
|
||||
}
|
||||
})
|
||||
models.backlink.forEach(item => {
|
||||
item.editors.forEach(editorItem => {
|
||||
editors.push(editorItem);
|
||||
});
|
||||
});
|
||||
window.siyuan.dialogs.forEach(item => {
|
||||
if (item.editor) {
|
||||
editors.push(item.editor)
|
||||
}
|
||||
});
|
||||
window.siyuan.blockPanels.forEach(item => {
|
||||
item.editors.forEach(editorItem => {
|
||||
editors.push(editorItem)
|
||||
});
|
||||
});
|
||||
return editors;
|
||||
};
|
||||
|
||||
export const getAllModels = () => {
|
||||
const models: IModels = {
|
||||
|
Loading…
Reference in New Issue
Block a user