From f6a4ccfc7dfed0120f932c1d86c932d5f06be98f Mon Sep 17 00:00:00 2001 From: Vanessa Date: Fri, 17 May 2024 23:35:36 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/11443 --- app/src/protyle/render/av/action.ts | 16 +++++++++------- app/src/protyle/render/av/cell.ts | 10 +++++----- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/app/src/protyle/render/av/action.ts b/app/src/protyle/render/av/action.ts index 5c72b4b67..f1055ab1e 100644 --- a/app/src/protyle/render/av/action.ts +++ b/app/src/protyle/render/av/action.ts @@ -272,13 +272,6 @@ export const avContextmenu = (protyle: IProtyle, rowElement: HTMLElement, positi type: "submenu", submenu: copySubMenu(blockId) }); - menu.addItem({ - label: window.siyuan.languages.unbindBlock, - icon: "iconLinkOff", - click() { - updateCellsValue(protyle, blockElement, keyCellElement.querySelector(".av__celltext").textContent, [keyCellElement]); - } - }); } if (!protyle.disabled) { menu.addItem({ @@ -366,6 +359,15 @@ ${window.siyuan.languages.insertRowAfter.replace("${x}", ' { const rowElement = hasClosestByClassName(item, "av__row"); if (!rowElement) { @@ -588,7 +588,7 @@ export const updateCellsValue = (protyle: IProtyle, nodeElement: HTMLElement, va (cellValue.type === "relation" && typeof cellValue.relation === "string")) { return; } - if (type === "select" || type === "mSelect") { + if (columns && (type === "select" || type === "mSelect")) { const operations = mergeAddOption(columns.find(e => e.id === colId), cellValue, avID); doOperations.push(...operations.doOperations); undoOperations.push(...operations.undoOperations); @@ -624,10 +624,10 @@ export const updateCellsValue = (protyle: IProtyle, nodeElement: HTMLElement, va rowID, data: oldValue }); - if (!isCustomAttr) { - updateAttrViewCellAnimation(item, cellValue); - } else { + if (isCustomAttr) { item.innerHTML = genAVValueHTML(cellValue); + } else { + updateAttrViewCellAnimation(item, cellValue); } }); if (doOperations.length > 0) {