mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 07:30:12 +01:00
This commit is contained in:
parent
76b886b89c
commit
d77d29cf78
3 changed files with 19 additions and 16 deletions
|
|
@ -114,21 +114,6 @@ export const bindLayoutEvent = (options: {
|
||||||
blockID,
|
blockID,
|
||||||
data: checked
|
data: checked
|
||||||
}]);
|
}]);
|
||||||
if (checked) {
|
|
||||||
options.blockElement.querySelector(".av__title").classList.remove("fn__none");
|
|
||||||
} else {
|
|
||||||
// hide
|
|
||||||
options.blockElement.querySelector(".av__title").classList.add("fn__none");
|
|
||||||
}
|
|
||||||
if (options.data.viewType === "gallery") {
|
|
||||||
const galleryElement = options.blockElement.querySelector(".av__gallery");
|
|
||||||
if (checked) {
|
|
||||||
galleryElement.classList.remove("av__gallery--top");
|
|
||||||
} else {
|
|
||||||
// hide
|
|
||||||
galleryElement.classList.add("av__gallery--top");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
if (options.data.viewType !== "gallery") {
|
if (options.data.viewType !== "gallery") {
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -485,6 +485,24 @@ export const refreshAV = (protyle: IProtyle, operation: IOperation) => {
|
||||||
coverItem.className = "av__gallery-cover av__gallery-cover--" + operation.data;
|
coverItem.className = "av__gallery-cover av__gallery-cover--" + operation.data;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
} else if (operation.action === "hideAttrViewName") {
|
||||||
|
Array.from(protyle.wysiwyg.element.querySelectorAll(`[data-av-id="${operation.avID}"]`)).forEach((item: HTMLElement) => {
|
||||||
|
if (!operation.data) {
|
||||||
|
item.querySelector(".av__title").classList.remove("fn__none");
|
||||||
|
} else {
|
||||||
|
// hide
|
||||||
|
item.querySelector(".av__title").classList.add("fn__none");
|
||||||
|
}
|
||||||
|
if (item.getAttribute("data-av-type") === "gallery") {
|
||||||
|
const galleryElement = item.querySelector(".av__gallery");
|
||||||
|
if (!operation.data) {
|
||||||
|
galleryElement.classList.remove("av__gallery--top");
|
||||||
|
} else {
|
||||||
|
// hide
|
||||||
|
galleryElement.classList.add("av__gallery--top");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
// 修改表格名 avID 传入到 id 上了 https://github.com/siyuan-note/siyuan/issues/12724
|
// 修改表格名 avID 传入到 id 上了 https://github.com/siyuan-note/siyuan/issues/12724
|
||||||
const avID = operation.action === "setAttrViewName" ? operation.id : operation.avID;
|
const avID = operation.action === "setAttrViewName" ? operation.id : operation.avID;
|
||||||
|
|
|
||||||
|
|
@ -854,7 +854,7 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo:
|
||||||
"removeAttrViewView", "setAttrViewViewName", "setAttrViewViewIcon", "duplicateAttrViewView", "sortAttrViewView",
|
"removeAttrViewView", "setAttrViewViewName", "setAttrViewViewIcon", "duplicateAttrViewView", "sortAttrViewView",
|
||||||
"updateAttrViewColRelation", "setAttrViewPageSize", "updateAttrViewColRollup", "sortAttrViewKey", "setAttrViewColDesc",
|
"updateAttrViewColRelation", "setAttrViewPageSize", "updateAttrViewColRollup", "sortAttrViewKey", "setAttrViewColDesc",
|
||||||
"duplicateAttrViewKey", "setAttrViewViewDesc", "setAttrViewCoverFrom", "setAttrViewCoverFromAssetKeyID",
|
"duplicateAttrViewKey", "setAttrViewViewDesc", "setAttrViewCoverFrom", "setAttrViewCoverFromAssetKeyID",
|
||||||
"setAttrViewBlockView", "setAttrViewCardSize", "setAttrViewCardAspectRatio"].includes(operation.action)) {
|
"setAttrViewBlockView", "setAttrViewCardSize", "setAttrViewCardAspectRatio", "hideAttrViewName"].includes(operation.action)) {
|
||||||
if (!isUndo) {
|
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);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue