Vanessa 2024-05-15 17:01:48 +08:00
parent 681489bc24
commit 0fa75ec71a
5 changed files with 14 additions and 9 deletions

View file

@ -30,6 +30,7 @@ import {addView, openViewMenu} from "./view";
import {isOnlyMeta, writeText} from "../../util/compatibility";
import {openSearchAV} from "./relation";
import {Constants} from "../../../constants";
import {hideElements} from "../../ui/hideElements";
export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLElement }) => {
if (isOnlyMeta(event)) {
@ -164,6 +165,7 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle
event.stopPropagation();
return true;
} else if (type === "block-more") {
window.siyuan.menus.menu.remove();
protyle.toolbar.range = document.createRange();
protyle.toolbar.range.selectNodeContents(target);
focusByRange(protyle.toolbar.range);
@ -231,6 +233,7 @@ export const avClick = (protyle: IProtyle, event: MouseEvent & { target: HTMLEle
};
export const avContextmenu = (protyle: IProtyle, rowElement: HTMLElement, position: IPosition) => {
hideElements(["hint"], protyle);
if (rowElement.classList.contains("av__row--header")) {
return false;
}

View file

@ -732,8 +732,9 @@ export const renderCell = (cellValue: IAVCellValue, rowIndex = 0) => {
}
}
if (["text", "template", "url", "email", "phone", "number", "date", "created", "updated", "lineNumber"].includes(cellValue.type) &&
(cellValue.type === "lineNumber" || (cellValue && cellValue[cellValue.type as "url"].content))) {
if ((["text", "template", "url", "email", "phone", "number", "date", "created", "updated"].includes(cellValue.type) && cellValue[cellValue.type as "url"]?.content) ||
cellValue.type === "lineNumber" ||
(cellValue.type === "block" && cellValue.block?.content)) {
text += `<span ${cellValue.type !== "number" ? "" : 'style="right:auto;left:5px"'} data-type="copy" class="block__icon"><svg><use xlink:href="#iconCopy"></use></svg></span>`;
}
return text;