mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 08:30:42 +02:00
🎨 Database gallery view https://github.com/siyuan-note/siyuan/issues/10414
This commit is contained in:
parent
f95d3b99bd
commit
a0b7998401
1 changed files with 14 additions and 1 deletions
|
@ -119,6 +119,20 @@ func ChangeAttrViewLayout(blockID, avID string, layout av.LayoutType) (err error
|
|||
|
||||
view.LayoutType = newLayout
|
||||
err = av.SaveAttributeView(attrView)
|
||||
|
||||
node, tree, err := getNodeByBlockID(nil, blockID)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
node.AttributeViewType = string(view.LayoutType)
|
||||
attrs := parse.IAL2Map(node.KramdownIAL)
|
||||
attrs[av.NodeAttrView] = view.ID
|
||||
err = setNodeAttrs(node, tree, attrs)
|
||||
if err != nil {
|
||||
logging.LogWarnf("set node [%s] attrs failed: %s", blockID, err)
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -469,7 +483,6 @@ func SetDatabaseBlockView(blockID, avID, viewID string) (err error) {
|
|||
}
|
||||
|
||||
node.AttributeViewType = string(view.LayoutType)
|
||||
|
||||
attrs := parse.IAL2Map(node.KramdownIAL)
|
||||
attrs[av.NodeAttrView] = viewID
|
||||
err = setNodeAttrs(node, tree, attrs)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue