mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 08:30:12 +01:00
This commit is contained in:
parent
5bf5684d17
commit
0e334d1ca0
2 changed files with 7 additions and 18 deletions
|
|
@ -636,22 +636,10 @@ export class Outline extends Model {
|
||||||
});
|
});
|
||||||
this.element.scrollTop = scrollTop;
|
this.element.scrollTop = scrollTop;
|
||||||
} else if (this.blockId) {
|
} else if (this.blockId) {
|
||||||
fetchPost("/api/storage/getOutlineStorage", {
|
if ((this.headerElement.querySelector("input.b3-text-field.search__label") as HTMLInputElement).value) {
|
||||||
docID: this.blockId
|
this.setFilter();
|
||||||
}, storageResponse => {
|
}
|
||||||
const storageData = storageResponse.data;
|
this.element.scrollTop = scrollTop;
|
||||||
if (storageData && storageData.expandIds) {
|
|
||||||
if (storageData.expandIds.length === 0) {
|
|
||||||
this.tree.collapseAll();
|
|
||||||
} else {
|
|
||||||
this.tree.setExpandIds(storageData.expandIds);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ((this.headerElement.querySelector("input.b3-text-field.search__label") as HTMLInputElement).value) {
|
|
||||||
this.setFilter();
|
|
||||||
}
|
|
||||||
this.element.scrollTop = scrollTop;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
if (currentId) {
|
if (currentId) {
|
||||||
currentElement = this.element.querySelector(`[data-node-id="${currentId}"]`);
|
currentElement = this.element.querySelector(`[data-node-id="${currentId}"]`);
|
||||||
|
|
|
||||||
|
|
@ -116,6 +116,7 @@ ${item.label ? "data-label='" + item.label + "'" : ""}>
|
||||||
data.forEach((item: IBlock & {
|
data.forEach((item: IBlock & {
|
||||||
subType: string;
|
subType: string;
|
||||||
count: string;
|
count: string;
|
||||||
|
folded?: boolean
|
||||||
ial?: {
|
ial?: {
|
||||||
icon: string
|
icon: string
|
||||||
}
|
}
|
||||||
|
|
@ -152,7 +153,7 @@ data-subtype="${item.subType}"
|
||||||
data-treetype="${type}"
|
data-treetype="${type}"
|
||||||
data-def-path="${item.defPath}">
|
data-def-path="${item.defPath}">
|
||||||
<span style="${style}" class="b3-list-item__toggle${item.children ? " b3-list-item__toggle--hl" : ""}${item.children ? "" : " fn__hidden"}">
|
<span style="${style}" class="b3-list-item__toggle${item.children ? " b3-list-item__toggle--hl" : ""}${item.children ? "" : " fn__hidden"}">
|
||||||
<svg data-id="${item.id}" class="b3-list-item__arrow"><use xlink:href="#iconRight"></use></svg>
|
<svg data-id="${item.id}" class="b3-list-item__arrow${(type === "outline" && !item.folded) ? " b3-list-item__arrow--open" : ""}"><use xlink:href="#iconRight"></use></svg>
|
||||||
</span>
|
</span>
|
||||||
${iconHTML}
|
${iconHTML}
|
||||||
<span class="b3-list-item__text ariaLabel" data-position="parentE" ${type === "outline" ? ' aria-label="' + escapeAriaLabel(Lute.BlockDOM2Content(item.content)) + '"' : ""}>${item.content}</span>
|
<span class="b3-list-item__text ariaLabel" data-position="parentE" ${type === "outline" ? ' aria-label="' + escapeAriaLabel(Lute.BlockDOM2Content(item.content)) + '"' : ""}>${item.content}</span>
|
||||||
|
|
@ -160,7 +161,7 @@ data-def-path="${item.defPath}">
|
||||||
${this.blockExtHTML || ""}
|
${this.blockExtHTML || ""}
|
||||||
</li>`;
|
</li>`;
|
||||||
if (item.children && item.children.length > 0) {
|
if (item.children && item.children.length > 0) {
|
||||||
html += this.genBlockHTML(item.children, false, type) + "</ul>";
|
html += this.genBlockHTML(item.children, (type === "outline" && !item.folded) ? true : false, type) + "</ul>";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return html;
|
return html;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue