mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 17:10:12 +01:00
🎨
This commit is contained in:
parent
2d96137033
commit
ad24ee9319
2 changed files with 12 additions and 8 deletions
|
|
@ -152,7 +152,6 @@ export class Outline extends Model {
|
||||||
fetchPost("/api/outline/getDocOutline", {
|
fetchPost("/api/outline/getDocOutline", {
|
||||||
id: this.blockId,
|
id: this.blockId,
|
||||||
}, response => {
|
}, response => {
|
||||||
this.updateDocTitle();
|
|
||||||
this.update(response);
|
this.update(response);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import {Backlinks} from "./Backlinks";
|
||||||
import {Model} from "../Model";
|
import {Model} from "../Model";
|
||||||
import {getDockByType, resizeTabs, setPanelFocus} from "../util";
|
import {getDockByType, resizeTabs, setPanelFocus} from "../util";
|
||||||
import {Inbox} from "./Inbox";
|
import {Inbox} from "./Inbox";
|
||||||
|
import Protyle from "../../protyle";
|
||||||
|
|
||||||
export class Dock {
|
export class Dock {
|
||||||
public element: HTMLElement;
|
public element: HTMLElement;
|
||||||
|
|
@ -127,11 +128,11 @@ export class Dock {
|
||||||
});
|
});
|
||||||
target.classList.add("dock__item--active");
|
target.classList.add("dock__item--active");
|
||||||
if (!target.getAttribute("data-id")) {
|
if (!target.getAttribute("data-id")) {
|
||||||
let editId = "";
|
let editor: Protyle;
|
||||||
const models = getAllModels();
|
const models = getAllModels();
|
||||||
models.editor.find((item) => {
|
models.editor.find((item) => {
|
||||||
if (item.parent.headElement.classList.contains("item--focus") && item.editor?.protyle?.path) {
|
if (item.parent.headElement.classList.contains("item--focus") && item.editor?.protyle?.path) {
|
||||||
editId = item.editor.protyle.block.rootID;
|
editor = item.editor;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -161,11 +162,15 @@ export class Dock {
|
||||||
case "outline":
|
case "outline":
|
||||||
tab = new Tab({
|
tab = new Tab({
|
||||||
callback(tab: Tab) {
|
callback(tab: Tab) {
|
||||||
tab.addModel(new Outline({
|
const outline = new Outline({
|
||||||
type: "pin",
|
type: "pin",
|
||||||
tab,
|
tab,
|
||||||
blockId: editId,
|
blockId: editor?.protyle?.block?.rootID,
|
||||||
}));
|
});
|
||||||
|
if (editor?.protyle?.title?.editElement) {
|
||||||
|
outline.updateDocTitle(editor.protyle.title.editElement.textContent);
|
||||||
|
}
|
||||||
|
tab.addModel(outline);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|
@ -174,7 +179,7 @@ export class Dock {
|
||||||
callback(tab: Tab) {
|
callback(tab: Tab) {
|
||||||
tab.addModel(new Graph({
|
tab.addModel(new Graph({
|
||||||
tab,
|
tab,
|
||||||
blockId: editId,
|
blockId: editor?.protyle?.block?.rootID,
|
||||||
type: "pin"
|
type: "pin"
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
@ -196,7 +201,7 @@ export class Dock {
|
||||||
tab.addModel(new Backlinks({
|
tab.addModel(new Backlinks({
|
||||||
type: "pin",
|
type: "pin",
|
||||||
tab,
|
tab,
|
||||||
blockId: editId,
|
blockId: editor?.protyle?.block?.rootID,
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue