mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 15:40:12 +01:00
This commit is contained in:
parent
97b32dd85d
commit
26524dfd15
1 changed files with 11 additions and 5 deletions
|
|
@ -148,12 +148,12 @@ func ChangeAttrViewLayout(blockID, avID string, layout av.LayoutType) (err error
|
||||||
}
|
}
|
||||||
|
|
||||||
view.LayoutType = newLayout
|
view.LayoutType = newLayout
|
||||||
err = av.SaveAttributeView(attrView)
|
|
||||||
|
|
||||||
blockIDs := treenode.GetMirrorAttrViewBlockIDs(avID)
|
blockIDs := treenode.GetMirrorAttrViewBlockIDs(avID)
|
||||||
for _, blockID := range blockIDs {
|
for _, bID := range blockIDs {
|
||||||
node, tree, err := getNodeByBlockID(nil, blockID)
|
node, tree, _ := getNodeByBlockID(nil, bID)
|
||||||
if err != nil {
|
if nil == node || nil == tree {
|
||||||
|
logging.LogErrorf("get node by block ID [%s] failed", bID)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -162,10 +162,16 @@ func ChangeAttrViewLayout(blockID, avID string, layout av.LayoutType) (err error
|
||||||
attrs[av.NodeAttrView] = view.ID
|
attrs[av.NodeAttrView] = view.ID
|
||||||
err = setNodeAttrs(node, tree, attrs)
|
err = setNodeAttrs(node, tree, attrs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logging.LogWarnf("set node [%s] attrs failed: %s", blockID, err)
|
logging.LogWarnf("set node [%s] attrs failed: %s", bID, err)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err = av.SaveAttributeView(attrView); nil != err {
|
||||||
|
logging.LogErrorf("save attribute view [%s] failed: %s", avID, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
ReloadAttrView(avID)
|
ReloadAttrView(avID)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue