From 68b38c0f0fb45cc51e0df2af2dcbef9dd042bc67 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Wed, 27 Dec 2023 21:28:45 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/9992 --- app/src/protyle/render/av/cell.ts | 1 + app/src/protyle/upload/index.ts | 15 +++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.ts index 8a202d663..cbd96eced 100644 --- a/app/src/protyle/render/av/cell.ts +++ b/app/src/protyle/render/av/cell.ts @@ -287,6 +287,7 @@ export const popTextCell = (protyle: IProtyle, cellElements: HTMLElement[], type openMenuPanel({protyle, blockElement, type: "select", cellElements}); } else if (type === "mAsset") { openMenuPanel({protyle, blockElement, type: "asset", cellElements}); + focusBlock(blockElement); } else if (type === "date") { openMenuPanel({protyle, blockElement, type: "date", cellElements}); } else if (type === "checkbox") { diff --git a/app/src/protyle/upload/index.ts b/app/src/protyle/upload/index.ts index 72ac0d862..9aef21d80 100644 --- a/app/src/protyle/upload/index.ts +++ b/app/src/protyle/upload/index.ts @@ -143,12 +143,19 @@ const genUploadedLabel = (responseText: string, protyle: IProtyle) => { } } }); - if (nodeElement && nodeElement.classList.contains("av")) { + if ((nodeElement && nodeElement.classList.contains("av"))) { updateCellsValue(protyle, nodeElement, avAssets); - } else { - // 避免插入代码块中,其次因为都要独立成块 https://github.com/siyuan-note/siyuan/issues/7607 - insertHTML(succFileText, protyle, insertBlock); + return } + if (document.querySelector(".av__panel")) { + const blockElement = hasClosestBlock(protyle.wysiwyg.element.querySelector(".av__cell--select")); + if (blockElement) { + updateCellsValue(protyle, blockElement, avAssets); + return; + } + } + // 避免插入代码块中,其次因为都要独立成块 https://github.com/siyuan-note/siyuan/issues/7607 + insertHTML(succFileText, protyle, insertBlock); }; export const uploadLocalFiles = (files: string[], protyle: IProtyle, isUpload: boolean) => {