mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-02-28 05:32:52 +00:00
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -40,6 +40,8 @@ export const getCellText = (cellElement: HTMLElement | false) => {
|
||||
textElements.forEach(item => {
|
||||
if (item.querySelector(".av__cellicon")) {
|
||||
cellText += `${item.firstChild.textContent} → ${item.lastChild.textContent}, `;
|
||||
} else if (item.getAttribute("data-type") === "url") {
|
||||
cellText = item.getAttribute("data-href") + ", ";
|
||||
} else if (item.getAttribute("data-type") !== "block-more") {
|
||||
cellText += item.textContent + ", ";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user