Vanessa 2024-03-28 18:26:35 +08:00
parent da6ba86948
commit 34fcbacea2
2 changed files with 14 additions and 5 deletions

View file

@ -33,12 +33,19 @@ export const initBlockPopover = (app: App) => {
if (textElement.scrollWidth > textElement.clientWidth + 2) {
tip = getCellText(aElement);
}
} else if (aElement.dataset.wrap !== "true" && event.target.dataset.type !== "block-more" && !hasClosestByClassName(event.target, "block__icon")) {
aElement.style.overflow = "auto";
if (aElement.scrollWidth > aElement.clientWidth + 2) {
tip = getCellText(aElement);
} else {
if (aElement.firstElementChild.getAttribute("data-type") === "url") {
if (aElement.firstElementChild.textContent.indexOf("...") > -1) {
tip = aElement.firstElementChild.getAttribute("data-href");
}
}
if (!tip && aElement.dataset.wrap !== "true" && event.target.dataset.type !== "block-more" && !hasClosestByClassName(event.target, "block__icon")) {
aElement.style.overflow = "auto";
if (aElement.scrollWidth > aElement.clientWidth + 2) {
tip = getCellText(aElement);
}
aElement.style.overflow = "";
}
aElement.style.overflow = "";
}
}
if (!tip) {