diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.ts
index b790f98b7..7f6c471ff 100644
--- a/app/src/protyle/render/av/cell.ts
+++ b/app/src/protyle/render/av/cell.ts
@@ -79,7 +79,7 @@ export const genCellValueByElement = (colType: TAVCol, cellElement: HTMLElement)
content: item.textContent,
id: item.dataset.id,
},
- type:"block"
+ type: "block"
});
});
cellValue.relation = {
@@ -656,11 +656,7 @@ export const renderCell = (cellValue: IAVCellValue) => {
} else if (cellValue.type === "relation") {
cellValue?.relation?.contents?.forEach((item) => {
if (item && item.block) {
- if (item.isDetached) {
- text += `${item.block.content || "Untitled"}, `;
- } else {
- text += `${item.block.content || "Untitled"}, `;
- }
+ text += renderRollup(item) + ", ";
}
});
if (text && text.endsWith(", ")) {
@@ -689,7 +685,7 @@ const renderRollup = (cellValue: IAVCellValue) => {
}
} else if (cellValue.type === "block") {
if (cellValue?.isDetached) {
- text = `${cellValue.block?.content || "Untitled"}`;
+ text = `${cellValue.block?.content || "Untitled"}`;
} else {
text = `${cellValue.block?.content || "Untitled"}`;
}
diff --git a/app/src/protyle/render/av/openMenuPanel.ts b/app/src/protyle/render/av/openMenuPanel.ts
index 2afd9b74a..c83bd7f13 100644
--- a/app/src/protyle/render/av/openMenuPanel.ts
+++ b/app/src/protyle/render/av/openMenuPanel.ts
@@ -365,7 +365,24 @@ export const openMenuPanel = (options: {
targetElement.after(sourceElement);
}
targetElement.classList.remove("dragover__bottom", "dragover__top");
- setRelationCell(options.protyle, options.blockElement as HTMLElement, sourceElement.parentElement, options.cellElements);
+ const blockIDs: string[] = [];
+ const contents: IAVCellValue[] = []
+ targetElement.parentElement.querySelectorAll(".fn__grab").forEach(item => {
+ const dateElement = item.nextElementSibling as HTMLElement
+ blockIDs.push(dateElement.dataset.id)
+ contents.push({
+ isDetached: !dateElement.style.color,
+ type: "block",
+ block: {
+ content: dateElement.textContent,
+ id: dateElement.dataset.id
+ }
+ })
+ })
+ updateCellsValue(options.protyle, options.blockElement as HTMLElement, {
+ blockIDs,
+ contents,
+ }, options.cellElements);
return;
}
diff --git a/app/src/protyle/render/av/relation.ts b/app/src/protyle/render/av/relation.ts
index 728031383..4ff32a138 100644
--- a/app/src/protyle/render/av/relation.ts
+++ b/app/src/protyle/render/av/relation.ts
@@ -212,11 +212,9 @@ export const toggleUpdateRelationBtn = (menuItemsElement: HTMLElement, avId: str
const genSelectItemHTML = (type: "selected" | "empty" | "unselect", id?: string, isDetached?: boolean, text?: string) => {
if (type === "selected") {
- return ``;
+ return `
+
+`;
}
if (type === "empty") {
return `