mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🎨 Improve av grouping https://github.com/siyuan-note/siyuan/issues/15429
This commit is contained in:
parent
6c0eed5d09
commit
34647490f2
1 changed files with 8 additions and 3 deletions
|
|
@ -303,13 +303,13 @@ func hideAttributeViewGroup(avID, blockID, groupID string, hidden int) (err erro
|
|||
}
|
||||
|
||||
func (tx *Transaction) doHideAttrViewAllGroups(operation *Operation) (ret *TxErr) {
|
||||
if err := hideAttributeViewAllGroups(operation.AvID, operation.BlockID, int(operation.Data.(float64))); nil != err {
|
||||
if err := hideAttributeViewAllGroups(operation.AvID, operation.BlockID, operation.Data.(bool)); nil != err {
|
||||
return &TxErr{code: TxErrHandleAttributeView, id: operation.AvID, msg: err.Error()}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func hideAttributeViewAllGroups(avID, blockID string, hidden int) (err error) {
|
||||
func hideAttributeViewAllGroups(avID, blockID string, hidden bool) (err error) {
|
||||
attrView, err := av.ParseAttributeView(avID)
|
||||
if err != nil {
|
||||
return
|
||||
|
|
@ -321,7 +321,12 @@ func hideAttributeViewAllGroups(avID, blockID string, hidden int) (err error) {
|
|||
}
|
||||
|
||||
for _, group := range view.Groups {
|
||||
group.GroupHidden = hidden
|
||||
if hidden {
|
||||
group.GroupHidden = 2
|
||||
} else {
|
||||
group.GroupHidden = 0
|
||||
}
|
||||
|
||||
break
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue