mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
🎨 Card view supports displaying field names https://github.com/siyuan-note/siyuan/issues/15180
This commit is contained in:
parent
ed4cc1faf6
commit
6270d55fa3
5 changed files with 5 additions and 7 deletions
|
@ -190,12 +190,12 @@ export const bindLayoutEvent = (options: {
|
||||||
const blockID = options.blockElement.getAttribute("data-node-id");
|
const blockID = options.blockElement.getAttribute("data-node-id");
|
||||||
const checked = toggleNameElement.checked;
|
const checked = toggleNameElement.checked;
|
||||||
transaction(options.protyle, [{
|
transaction(options.protyle, [{
|
||||||
action: "setDisplayFieldName",
|
action: "setAttrViewDisplayFieldName",
|
||||||
avID,
|
avID,
|
||||||
blockID,
|
blockID,
|
||||||
data: checked
|
data: checked
|
||||||
}], [{
|
}], [{
|
||||||
action: "setDisplayFieldName",
|
action: "setAttrViewDisplayFieldName",
|
||||||
avID,
|
avID,
|
||||||
blockID,
|
blockID,
|
||||||
data: !checked
|
data: !checked
|
||||||
|
|
|
@ -864,7 +864,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", "removeAttrViewGroup", "hideAttrViewGroup", "sortAttrViewGroup",
|
"setAttrViewWrapField", "setAttrViewGroup", "removeAttrViewGroup", "hideAttrViewGroup", "sortAttrViewGroup",
|
||||||
"foldAttrViewGroup", "hideAttrViewAllGroups", "setAttrViewFitImage", "setDisplayFieldName"].includes(operation.action)) {
|
"foldAttrViewGroup", "hideAttrViewAllGroups", "setAttrViewFitImage", "setAttrViewDisplayFieldName"].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);
|
||||||
|
|
2
app/src/types/index.d.ts
vendored
2
app/src/types/index.d.ts
vendored
|
@ -69,7 +69,7 @@ type TOperation =
|
||||||
| "hideAttrViewGroup"
|
| "hideAttrViewGroup"
|
||||||
| "sortAttrViewGroup"
|
| "sortAttrViewGroup"
|
||||||
| "foldAttrViewGroup"
|
| "foldAttrViewGroup"
|
||||||
| "setDisplayFieldName"
|
| "setAttrViewDisplayFieldName"
|
||||||
type TBazaarType = "templates" | "icons" | "widgets" | "themes" | "plugins"
|
type TBazaarType = "templates" | "icons" | "widgets" | "themes" | "plugins"
|
||||||
type TCardType = "doc" | "notebook" | "all"
|
type TCardType = "doc" | "notebook" | "all"
|
||||||
type TEventBus = "ws-main" | "sync-start" | "sync-end" | "sync-fail" |
|
type TEventBus = "ws-main" | "sync-start" | "sync-end" | "sync-fail" |
|
||||||
|
|
|
@ -790,8 +790,6 @@ func setAttrViewDisplayFieldName(operation *Operation) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
err = av.SaveAttributeView(attrView)
|
err = av.SaveAttributeView(attrView)
|
||||||
|
|
||||||
ReloadAttrView(operation.AvID)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -287,7 +287,7 @@ func performTx(tx *Transaction) (ret *TxErr) {
|
||||||
ret = tx.doSetAttrViewCardSize(op)
|
ret = tx.doSetAttrViewCardSize(op)
|
||||||
case "setAttrViewFitImage":
|
case "setAttrViewFitImage":
|
||||||
ret = tx.doSetAttrViewFitImage(op)
|
ret = tx.doSetAttrViewFitImage(op)
|
||||||
case "setDisplayFieldName":
|
case "setAttrViewDisplayFieldName":
|
||||||
ret = tx.doSetAttrViewDisplayFieldName(op)
|
ret = tx.doSetAttrViewDisplayFieldName(op)
|
||||||
case "setAttrViewShowIcon":
|
case "setAttrViewShowIcon":
|
||||||
ret = tx.doSetAttrViewShowIcon(op)
|
ret = tx.doSetAttrViewShowIcon(op)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue