mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
🎨 Improve av https://github.com/siyuan-note/siyuan/issues/15592
This commit is contained in:
parent
e746093a0f
commit
93580cc27f
2 changed files with 7 additions and 3 deletions
|
|
@ -1817,6 +1817,7 @@ func genAttrViewGroups(view *av.View, attrView *av.AttributeView) {
|
|||
}
|
||||
|
||||
v.Name = "" // 分组视图的名称在渲染时才填充
|
||||
v.GroupHidden = 1 // 默认隐藏空白分组
|
||||
v.GroupKey = groupKey
|
||||
v.GroupVal = &av.Value{Type: av.KeyTypeText, Text: &av.ValueText{Content: groupValue}}
|
||||
if av.KeyTypeSelect == groupKey.Type || av.KeyTypeMSelect == groupKey.Type {
|
||||
|
|
|
|||
|
|
@ -185,11 +185,14 @@ func hideEmptyGroupViews(view *av.View, viewable av.Viewable) {
|
|||
}
|
||||
|
||||
if !view.Group.HideEmpty {
|
||||
if 2 != viewable.GetGroupHidden() {
|
||||
viewable.SetGroupHidden(0)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if 2 != viewable.GetGroupHidden() && 1 > viewable.(av.Collection).CountItems() {
|
||||
viewable.SetGroupHidden(1)
|
||||
if 1 == viewable.GetGroupHidden() && 0 < viewable.(av.Collection).CountItems() {
|
||||
viewable.SetGroupHidden(0)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue