mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-19 10:30:45 +08:00
This commit is contained in:
parent
a3e6b69280
commit
6f58d1387f
@ -278,13 +278,25 @@ export const avContextmenu = (protyle: IProtyle, event: MouseEvent & { detail: a
|
|||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
const editAttrSubmenu: IMenu[] = [];
|
const editAttrSubmenu: IMenu[] = [];
|
||||||
rowElement.parentElement.querySelectorAll(".av__row--header .av__cell").forEach((cellElement: HTMLElement) => {
|
rowElement.parentElement.querySelectorAll(".av__row--header .av__cell").forEach((cellElement: HTMLElement) => {
|
||||||
editAttrSubmenu.push({
|
let hideBlock = false
|
||||||
icon: getColIconByType(cellElement.getAttribute("data-dtype") as TAVCol),
|
const selectElements: HTMLElement[] = Array.from(blockElement.querySelectorAll(`.av__row--select:not(.av__row--header) .av__cell[data-col-id="${cellElement.dataset.colId}"]`))
|
||||||
label: cellElement.textContent.trim(),
|
if (cellElement.dataset.dtype === "block") {
|
||||||
click() {
|
selectElements.find(item => {
|
||||||
popTextCell(protyle, Array.from(blockElement.querySelectorAll(`.av__row--select:not(.av__row--header) .av__cell[data-col-id="${cellElement.dataset.colId}"]`)));
|
if (!item.dataset.detached) {
|
||||||
}
|
hideBlock = true;
|
||||||
});
|
return true;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (!hideBlock) {
|
||||||
|
editAttrSubmenu.push({
|
||||||
|
icon: getColIconByType(cellElement.getAttribute("data-dtype") as TAVCol),
|
||||||
|
label: cellElement.textContent.trim(),
|
||||||
|
click() {
|
||||||
|
popTextCell(protyle, selectElements);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
menu.addItem({
|
menu.addItem({
|
||||||
icon: "iconAttr",
|
icon: "iconAttr",
|
||||||
|
Loading…
Reference in New Issue
Block a user