mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-17 17:40:42 +08:00
This commit is contained in:
parent
0ad0d416c4
commit
f6a4ccfc7d
@ -272,13 +272,6 @@ export const avContextmenu = (protyle: IProtyle, rowElement: HTMLElement, positi
|
|||||||
type: "submenu",
|
type: "submenu",
|
||||||
submenu: copySubMenu(blockId)
|
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) {
|
if (!protyle.disabled) {
|
||||||
menu.addItem({
|
menu.addItem({
|
||||||
@ -366,6 +359,15 @@ ${window.siyuan.languages.insertRowAfter.replace("${x}", '<span class="fn__space
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
|
if (keyCellElement.getAttribute("data-detached") !== "true") {
|
||||||
|
menu.addItem({
|
||||||
|
label: window.siyuan.languages.unbindBlock,
|
||||||
|
icon: "iconLinkOff",
|
||||||
|
click() {
|
||||||
|
updateCellsValue(protyle, blockElement, keyCellElement.querySelector(".av__celltext").textContent, [keyCellElement]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
menu.addItem({
|
menu.addItem({
|
||||||
icon: "iconTrashcan",
|
icon: "iconTrashcan",
|
||||||
|
@ -537,7 +537,7 @@ export const updateCellsValue = (protyle: IProtyle, nodeElement: HTMLElement, va
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const isCustomAttr = !hasClosestByClassName(cellElements[0], "custom-attr");
|
const isCustomAttr = hasClosestByClassName(cellElements[0], "custom-attr");
|
||||||
cellElements.forEach((item: HTMLElement, elementIndex) => {
|
cellElements.forEach((item: HTMLElement, elementIndex) => {
|
||||||
const rowElement = hasClosestByClassName(item, "av__row");
|
const rowElement = hasClosestByClassName(item, "av__row");
|
||||||
if (!rowElement) {
|
if (!rowElement) {
|
||||||
@ -588,7 +588,7 @@ export const updateCellsValue = (protyle: IProtyle, nodeElement: HTMLElement, va
|
|||||||
(cellValue.type === "relation" && typeof cellValue.relation === "string")) {
|
(cellValue.type === "relation" && typeof cellValue.relation === "string")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (type === "select" || type === "mSelect") {
|
if (columns && (type === "select" || type === "mSelect")) {
|
||||||
const operations = mergeAddOption(columns.find(e => e.id === colId), cellValue, avID);
|
const operations = mergeAddOption(columns.find(e => e.id === colId), cellValue, avID);
|
||||||
doOperations.push(...operations.doOperations);
|
doOperations.push(...operations.doOperations);
|
||||||
undoOperations.push(...operations.undoOperations);
|
undoOperations.push(...operations.undoOperations);
|
||||||
@ -624,10 +624,10 @@ export const updateCellsValue = (protyle: IProtyle, nodeElement: HTMLElement, va
|
|||||||
rowID,
|
rowID,
|
||||||
data: oldValue
|
data: oldValue
|
||||||
});
|
});
|
||||||
if (!isCustomAttr) {
|
if (isCustomAttr) {
|
||||||
updateAttrViewCellAnimation(item, cellValue);
|
|
||||||
} else {
|
|
||||||
item.innerHTML = genAVValueHTML(cellValue);
|
item.innerHTML = genAVValueHTML(cellValue);
|
||||||
|
} else {
|
||||||
|
updateAttrViewCellAnimation(item, cellValue);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (doOperations.length > 0) {
|
if (doOperations.length > 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user