This commit is contained in:
parent
c9f5a2de3d
commit
66f711d48d
1 changed files with 3 additions and 3 deletions
|
@ -16,7 +16,7 @@ export const renderBacklink = (protyle: IProtyle, backlinkData: {
|
|||
protyle.block.showAll = true;
|
||||
let html = "";
|
||||
backlinkData.forEach(item => {
|
||||
html += genBreadcrumb(item.blockPaths) + setBacklinkFold(item.dom, item.expand);
|
||||
html += genBreadcrumb(item.blockPaths, false, backlinkData.length) + setBacklinkFold(item.dom, item.expand);
|
||||
});
|
||||
protyle.wysiwyg.element.innerHTML = html;
|
||||
processRender(protyle.wysiwyg.element);
|
||||
|
@ -99,9 +99,9 @@ export const getBacklinkHeadingMore = (moreElement: HTMLElement) => {
|
|||
moreElement.remove();
|
||||
};
|
||||
|
||||
export const genBreadcrumb = (blockPaths: IBreadcrumb[], renderFirst = false) => {
|
||||
export const genBreadcrumb = (blockPaths: IBreadcrumb[], renderFirst: boolean, parentLength?: number) => {
|
||||
if (1 > blockPaths.length) {
|
||||
return '<div contenteditable="false" style="border-top: 1px solid var(--b3-border-color);min-height: 0;width: 100%;" class="protyle-breadcrumb__bar"><span></span></div>';
|
||||
return `<div contenteditable="false" style="border-top: ${parentLength === 1 ? 0 : 1}px solid var(--b3-border-color);min-height: 0;width: 100%;" class="protyle-breadcrumb__bar"><span></span></div>`;
|
||||
}
|
||||
|
||||
let html = "";
|
||||
|
|
Loading…
Add table
Reference in a new issue