This commit is contained in:
Vanessa 2023-02-23 14:06:25 +08:00
parent 9db10e36e7
commit a240361257

View file

@ -1515,6 +1515,10 @@ export class WYSIWYG {
event.stopPropagation();
}
});
// 面包屑定位,需至于前,否则 return 的元素就无法进行面包屑定位
if (protyle.options.render.breadcrumb) {
protyle.breadcrumb.render(protyle);
}
const range = getEditorRange(this.element);
// 需放在嵌入块之前否则嵌入块内的引用、链接、pdf 双链无法点击打开 https://ld246.com/article/1630479789513
const blockRefElement = hasClosestByAttribute(event.target, "data-type", "block-ref");
@ -1860,6 +1864,10 @@ export class WYSIWYG {
range.setStartAfter(imgElement);
range.collapse(true);
focusByRange(range);
// 需等待 range 更新再次进行渲染
if (protyle.options.render.breadcrumb) {
protyle.breadcrumb.render(protyle);
}
return;
}
@ -2052,11 +2060,6 @@ export class WYSIWYG {
countBlockWord(ids);
}
}
// 面包屑定位
if (protyle.options.render.breadcrumb) {
protyle.breadcrumb.render(protyle);
}
});
}
}