mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 01:50:12 +01:00
This commit is contained in:
parent
c211137af7
commit
2b91919103
2 changed files with 9 additions and 21 deletions
|
|
@ -204,6 +204,8 @@ const switchEditor = (editor: Editor, options: IOpenFileOptions, allModels: IMod
|
||||||
size: Constants.SIZE_GET,
|
size: Constants.SIZE_GET,
|
||||||
}, getResponse => {
|
}, getResponse => {
|
||||||
onGet(getResponse, editor.editor.protyle, options.action);
|
onGet(getResponse, editor.editor.protyle, options.action);
|
||||||
|
// 大纲点击折叠标题下的内容时,需更新反链面板
|
||||||
|
updateBacklinkGraph(allModels, editor.editor.protyle);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (options.action.includes(Constants.CB_GET_HL)) {
|
if (options.action.includes(Constants.CB_GET_HL)) {
|
||||||
|
|
|
||||||
|
|
@ -94,27 +94,13 @@ export class Outline extends Model {
|
||||||
element: options.tab.panelElement.lastElementChild as HTMLElement,
|
element: options.tab.panelElement.lastElementChild as HTMLElement,
|
||||||
data: null,
|
data: null,
|
||||||
click: (element: HTMLElement) => {
|
click: (element: HTMLElement) => {
|
||||||
const models = getAllModels();
|
const id = element.getAttribute("data-node-id");
|
||||||
models.editor.find(item => {
|
fetchPost("/api/block/checkBlockFold", {id}, (foldResponse) => {
|
||||||
if (this.blockId === item.editor.protyle.block.rootID && !item.element.classList.contains("fn__none")) {
|
openFileById({
|
||||||
const id = element.getAttribute("data-node-id");
|
id,
|
||||||
const targetElement = item.editor.protyle.wysiwyg.element.querySelector(`[data-node-id="${id}"]`);
|
hasContext: !foldResponse.data,
|
||||||
if (targetElement) {
|
action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_SETID],
|
||||||
targetElement.scrollIntoView();
|
});
|
||||||
focusBlock(targetElement);
|
|
||||||
pushBack(item.editor.protyle, undefined, targetElement);
|
|
||||||
} else {
|
|
||||||
fetchPost("/api/block/checkBlockFold", {id}, (foldResponse) => {
|
|
||||||
openFileById({
|
|
||||||
id,
|
|
||||||
hasContext: !foldResponse.data,
|
|
||||||
action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL] : [Constants.CB_GET_FOCUS, Constants.CB_GET_SETID],
|
|
||||||
});
|
|
||||||
updateBacklinkGraph(models, item.editor.protyle);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue