mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 15:40:12 +01:00
This commit is contained in:
parent
3a1803c8da
commit
d61fbd83c6
2 changed files with 11 additions and 7 deletions
|
|
@ -546,18 +546,22 @@ export const refreshAV = (protyle: IProtyle, operation: IOperation) => {
|
||||||
item.querySelector(".av__drag-fill")?.remove();
|
item.querySelector(".av__drag-fill")?.remove();
|
||||||
});
|
});
|
||||||
addDragFill(item.querySelector(".av__cell--select"));
|
addDragFill(item.querySelector(".av__cell--select"));
|
||||||
}
|
} else if (operation.action === "setAttrViewBlockView") {
|
||||||
if (operation.action === "setAttrViewBlockView") {
|
|
||||||
const viewTabElement = item.querySelector(`.av__views > .layout-tab-bar > .item[data-id="${operation.id}"]`) as HTMLElement;
|
const viewTabElement = item.querySelector(`.av__views > .layout-tab-bar > .item[data-id="${operation.id}"]`) as HTMLElement;
|
||||||
if (viewTabElement) {
|
if (viewTabElement) {
|
||||||
item.dataset.pageSize = viewTabElement.dataset.page;
|
item.dataset.pageSize = viewTabElement.dataset.page;
|
||||||
}
|
}
|
||||||
}
|
} else if (operation.action === "addAttrViewView") {
|
||||||
if (operation.action === "addAttrViewView") {
|
|
||||||
item.dataset.pageSize = "50";
|
item.dataset.pageSize = "50";
|
||||||
}
|
} else if (operation.action === "removeAttrViewView") {
|
||||||
if (operation.action === "removeAttrViewView") {
|
|
||||||
item.dataset.pageSize = item.querySelector(`.av__views > .layout-tab-bar .item[data-id="${item.getAttribute(Constants.CUSTOM_SY_AV_VIEW)}"]`)?.getAttribute("data-page");
|
item.dataset.pageSize = item.querySelector(`.av__views > .layout-tab-bar .item[data-id="${item.getAttribute(Constants.CUSTOM_SY_AV_VIEW)}"]`)?.getAttribute("data-page");
|
||||||
|
} else if (operation.action === "sortAttrViewView" && operation.data === "unRefresh") {
|
||||||
|
const viewTabElement = item.querySelector(`.av__views > .layout-tab-bar > .item[data-id="${operation.id}"]`) as HTMLElement;
|
||||||
|
if (viewTabElement && !operation.previousID && !viewTabElement.previousElementSibling) {
|
||||||
|
return;
|
||||||
|
} else if (viewTabElement && operation.previousID && viewTabElement.previousElementSibling?.getAttribute("data-id") === operation.previousID) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
avRender(item, protyle, () => {
|
avRender(item, protyle, () => {
|
||||||
const attrElement = document.querySelector(`.b3-dialog--open[data-key="${Constants.DIALOG_ATTR}"] div[data-av-id="${avID}"]`) as HTMLElement;
|
const attrElement = document.querySelector(`.b3-dialog--open[data-key="${Constants.DIALOG_ATTR}"] div[data-av-id="${avID}"]`) as HTMLElement;
|
||||||
|
|
|
||||||
|
|
@ -856,7 +856,7 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo:
|
||||||
"duplicateAttrViewKey", "setAttrViewViewDesc", "setAttrViewCoverFrom", "setAttrViewCoverFromAssetKeyID",
|
"duplicateAttrViewKey", "setAttrViewViewDesc", "setAttrViewCoverFrom", "setAttrViewCoverFromAssetKeyID",
|
||||||
"setAttrViewBlockView", "setAttrViewCardSize", "setAttrViewCardAspectRatio", "hideAttrViewName", "setAttrViewShowIcon",
|
"setAttrViewBlockView", "setAttrViewCardSize", "setAttrViewCardAspectRatio", "hideAttrViewName", "setAttrViewShowIcon",
|
||||||
"setAttrViewWrapField", "setAttrViewGroup"].includes(operation.action)) {
|
"setAttrViewWrapField", "setAttrViewGroup"].includes(operation.action)) {
|
||||||
if (!isUndo && operation.data !== "unRefresh") {
|
if (!isUndo) {
|
||||||
// 撤销 transaction 会进行推送,需使用推送来进行刷新最新数据 https://github.com/siyuan-note/siyuan/issues/13607
|
// 撤销 transaction 会进行推送,需使用推送来进行刷新最新数据 https://github.com/siyuan-note/siyuan/issues/13607
|
||||||
refreshAV(protyle, operation);
|
refreshAV(protyle, operation);
|
||||||
} else if (operation.action === "setAttrViewName") {
|
} else if (operation.action === "setAttrViewName") {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue