diff --git a/app/src/assets/scss/business/_av.scss b/app/src/assets/scss/business/_av.scss index 6633772cb..c7703aa55 100644 --- a/app/src/assets/scss/business/_av.scss +++ b/app/src/assets/scss/business/_av.scss @@ -431,6 +431,10 @@ margin-left: 0; } + .b3-menu__avemoji { + display: none; + } + &[data-empty="true"] .av__gallery-tip { display: flex; } diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.ts index e5a408d33..dceb3b462 100644 --- a/app/src/protyle/util/editorCommonEvent.ts +++ b/app/src/protyle/util/editorCommonEvent.ts @@ -1120,7 +1120,8 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => { transaction(protyle, doOperations, undoOperations); } else { const newUpdated = dayjs().format("YYYYMMDDHHmmss"); - const groupID = targetElement.parentElement.getAttribute("data-group-id"); + const bodyElement = hasClosestByClassName(targetElement, "av__body"); + const groupID = bodyElement && bodyElement.getAttribute("data-group-id"); transaction(protyle, [{ action: "insertAttrViewBlock", avID, @@ -1194,13 +1195,14 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => { transaction(protyle, doOperations, undoOperations); } else { const newUpdated = dayjs().format("YYYYMMDDHHmmss"); + const bodyElement = hasClosestByClassName(targetElement, "av__body"); transaction(protyle, [{ action: "insertAttrViewBlock", avID, previousID, srcs, blockID: blockElement.dataset.nodeId, - groupID: targetElement.parentElement.getAttribute("data-group-id") + groupID: bodyElement && bodyElement.getAttribute("data-group-id") }, { action: "doUpdateUpdated", id: blockElement.dataset.nodeId, @@ -1310,7 +1312,8 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => { const avID = blockElement.getAttribute("data-av-id"); const newUpdated = dayjs().format("YYYYMMDDHHmmss"); const srcs: IOperationSrcs[] = []; - const groupID = targetElement.parentElement.getAttribute("data-group-id"); + const bodyElement = hasClosestByClassName(targetElement, "av__body"); + const groupID = bodyElement && bodyElement.getAttribute("data-group-id"); ids.forEach(id => { srcs.push({ id,