mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-31 04:35:16 +01:00
This commit is contained in:
parent
f89ef1b9c5
commit
bb6139efc1
2 changed files with 8 additions and 2 deletions
|
|
@ -3042,8 +3042,12 @@ export class WYSIWYG {
|
|||
if (rangeElement === this.element) {
|
||||
rangeElement = document.elementFromPoint(rect.left + rect.width / 2, event.clientY + 8);
|
||||
}
|
||||
const blockElement = hasClosestBlock(rangeElement);
|
||||
let blockElement = hasClosestBlock(rangeElement);
|
||||
if (blockElement) {
|
||||
const embedElement = isInEmbedBlock(blockElement)
|
||||
if (embedElement) {
|
||||
blockElement = embedElement;
|
||||
}
|
||||
newRange = focusBlock(blockElement, undefined, event.clientX < rect.left + parseInt(this.element.style.paddingLeft)) || newRange;
|
||||
if (protyle.options.render.breadcrumb) {
|
||||
protyle.breadcrumb.render(protyle, false, blockElement);
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import {highlightRender} from "../render/highlightRender";
|
|||
import {blockRender} from "../render/blockRender";
|
||||
import {disabledForeverProtyle, disabledProtyle} from "../util/onGet";
|
||||
import {avRender} from "../render/av/render";
|
||||
import {hasClosestByAttribute} from "../util/hasClosest";
|
||||
|
||||
export const renderBacklink = (protyle: IProtyle, backlinkData: {
|
||||
blockPaths: IBreadcrumb[],
|
||||
|
|
@ -129,9 +130,10 @@ export const improveBreadcrumbAppearance = (element: HTMLElement) => {
|
|||
return;
|
||||
}
|
||||
let jump = false;
|
||||
const isEmbed = hasClosestByAttribute(item, "data-type", "NodeBlockQueryEmbed");
|
||||
while (item.scrollHeight > 30 && !jump && itemElements.length > 1) {
|
||||
itemElements.find((item, index) => {
|
||||
if (index > 0) {
|
||||
if (index > (isEmbed ? 0 : -1)) {
|
||||
if (!item.classList.contains("protyle-breadcrumb__text--ellipsis")) {
|
||||
item.classList.add("protyle-breadcrumb__text--ellipsis");
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue