mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-31 22:08:48 +01:00
🎨 Improve av https://github.com/siyuan-note/siyuan/issues/15523
This commit is contained in:
parent
31667b0964
commit
e871f4913f
2 changed files with 22 additions and 2 deletions
|
|
@ -1742,11 +1742,11 @@ func genAttrViewGroups(view *av.View, attrView *av.AttributeView) {
|
|||
v.GroupVal.MSelect = []*av.ValueSelect{{Content: opt.Name, Color: opt.Color}}
|
||||
}
|
||||
}
|
||||
v.GroupSort = -1
|
||||
view.Groups = append(view.Groups, v)
|
||||
}
|
||||
|
||||
view.GroupCreated = time.Now().UnixMilli()
|
||||
|
||||
setAttrViewGroupStates(view, groupStates)
|
||||
}
|
||||
|
||||
|
|
@ -1784,6 +1784,26 @@ func setAttrViewGroupStates(view *av.View, groupStates map[string]*GroupState) {
|
|||
groupView.GroupSort = state.Sort
|
||||
}
|
||||
}
|
||||
|
||||
defaultGroup := view.GetGroupByGroupValue(groupValueDefault)
|
||||
if nil != defaultGroup {
|
||||
if -1 == defaultGroup.GroupSort {
|
||||
view.RemoveGroupByID(defaultGroup.ID)
|
||||
} else {
|
||||
defaultGroup = nil
|
||||
}
|
||||
}
|
||||
|
||||
for i, groupView := range view.Groups {
|
||||
if i != groupView.GroupSort && -1 == groupView.GroupSort {
|
||||
groupView.GroupSort = i
|
||||
}
|
||||
}
|
||||
|
||||
if nil != defaultGroup {
|
||||
view.Groups = append(view.Groups, defaultGroup)
|
||||
defaultGroup.GroupSort = len(view.Groups) - 1
|
||||
}
|
||||
}
|
||||
|
||||
func GetCurrentAttributeViewImages(avID, viewID, query string) (ret []string, err error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue