mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-05 16:28:49 +01:00
🎨 Database grouping by field https://github.com/siyuan-note/siyuan/issues/10964
This commit is contained in:
parent
400153319e
commit
4694a8c6c1
1 changed files with 13 additions and 7 deletions
|
|
@ -3558,15 +3558,21 @@ func sortAttributeViewRow(operation *Operation) (err error) {
|
|||
groupView.GroupItemIDs = append(groupView.GroupItemIDs, itemID)
|
||||
idx = len(groupView.GroupItemIDs) - 1
|
||||
}
|
||||
|
||||
groupView.GroupItemIDs = append(groupView.GroupItemIDs[:idx], groupView.GroupItemIDs[idx+1:]...)
|
||||
for i, r := range groupView.GroupItemIDs {
|
||||
if r == operation.PreviousID {
|
||||
previousIndex = i + 1
|
||||
break
|
||||
}
|
||||
|
||||
targetGroupView := groupView
|
||||
if operation.GroupID != operation.TargetGroupID { // 跨分组拖拽
|
||||
targetGroupView = view.GetGroup(operation.TargetGroupID)
|
||||
}
|
||||
if nil != targetGroupView {
|
||||
for i, r := range targetGroupView.GroupItemIDs {
|
||||
if r == operation.PreviousID {
|
||||
previousIndex = i + 1
|
||||
break
|
||||
}
|
||||
}
|
||||
targetGroupView.GroupItemIDs = util.InsertElem(targetGroupView.GroupItemIDs, previousIndex, itemID)
|
||||
}
|
||||
groupView.GroupItemIDs = util.InsertElem(view.ItemIDs, previousIndex, itemID)
|
||||
}
|
||||
} else {
|
||||
for i, id := range view.ItemIDs {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue