mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 01:20:12 +01:00
This commit is contained in:
parent
3ce6e4824b
commit
445108525f
3 changed files with 4 additions and 4 deletions
|
|
@ -694,6 +694,7 @@ export const openMenuPanel = (options: {
|
||||||
avID,
|
avID,
|
||||||
id
|
id
|
||||||
}]);
|
}]);
|
||||||
|
options.blockElement.setAttribute("custom-sy-av-view", id)
|
||||||
avPanelElement.remove();
|
avPanelElement.remove();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
|
|
||||||
|
|
@ -54,8 +54,6 @@ export const avRender = (element: Element, protyle: IProtyle, cb?: () => void, v
|
||||||
newViewID = viewID;
|
newViewID = viewID;
|
||||||
fetchPost("/api/av/setDatabaseBlockView", {id: e.dataset.nodeId, viewID});
|
fetchPost("/api/av/setDatabaseBlockView", {id: e.dataset.nodeId, viewID});
|
||||||
e.setAttribute("custom-sy-av-view", newViewID);
|
e.setAttribute("custom-sy-av-view", newViewID);
|
||||||
} else if (typeof viewID === "undefined") {
|
|
||||||
newViewID = e.querySelector(".av__header .item--focus")?.getAttribute("data-id");
|
|
||||||
}
|
}
|
||||||
fetchPost(created ? "/api/av/renderHistoryAttributeView" : (snapshot ? "/api/av/renderSnapshotAttributeView" : "/api/av/renderAttributeView"), {
|
fetchPost(created ? "/api/av/renderHistoryAttributeView" : (snapshot ? "/api/av/renderSnapshotAttributeView" : "/api/av/renderAttributeView"), {
|
||||||
id: e.getAttribute("data-av-id"),
|
id: e.getAttribute("data-av-id"),
|
||||||
|
|
@ -309,8 +307,7 @@ export const refreshAV = (protyle: IProtyle, operation: IOperation) => {
|
||||||
// 更新属性面板
|
// 更新属性面板
|
||||||
renderAVAttribute(attrElement.parentElement, attrElement.dataset.nodeId, protyle);
|
renderAVAttribute(attrElement.parentElement, attrElement.dataset.nodeId, protyle);
|
||||||
}
|
}
|
||||||
}, ["addAttrViewView", "duplicateAttrViewView"].includes(operation.action) ? operation.id :
|
});
|
||||||
(operation.action === "removeAttrViewView" ? null : undefined));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, ["insertAttrViewBlock"].includes(operation.action) ? 2 : 100);
|
}, ["insertAttrViewBlock"].includes(operation.action) ? 2 : 100);
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@ export const openViewMenu = (options: { protyle: IProtyle, blockElement: HTMLEle
|
||||||
avID: options.blockElement.dataset.avId,
|
avID: options.blockElement.dataset.avId,
|
||||||
id
|
id
|
||||||
}]);
|
}]);
|
||||||
|
options.blockElement.setAttribute("custom-sy-av-view", id)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
menu.addItem({
|
menu.addItem({
|
||||||
|
|
@ -204,4 +205,5 @@ export const addView = (protyle: IProtyle, blockElement: Element) => {
|
||||||
avID,
|
avID,
|
||||||
id
|
id
|
||||||
}]);
|
}]);
|
||||||
|
blockElement.setAttribute("custom-sy-av-view", id);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue