mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-01 22:38:49 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
50156a0dc9
1 changed files with 13 additions and 3 deletions
|
|
@ -1880,10 +1880,20 @@ func addAttributeViewColumn(operation *Operation) (err error) {
|
|||
key := av.NewKey(operation.ID, operation.Name, icon, keyType)
|
||||
attrView.KeyValues = append(attrView.KeyValues, &av.KeyValues{Key: key})
|
||||
|
||||
for _, v := range attrView.Views {
|
||||
switch v.LayoutType {
|
||||
for _, view := range attrView.Views {
|
||||
switch view.LayoutType {
|
||||
case av.LayoutTypeTable:
|
||||
v.Table.Columns = append(v.Table.Columns, &av.ViewTableColumn{ID: key.ID})
|
||||
added := false
|
||||
for i, column := range view.Table.Columns {
|
||||
if column.ID == operation.PreviousID {
|
||||
view.Table.Columns = append(view.Table.Columns[:i+1], append([]*av.ViewTableColumn{{ID: key.ID}}, view.Table.Columns[i+1:]...)...)
|
||||
added = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if !added {
|
||||
view.Table.Columns = append(view.Table.Columns, &av.ViewTableColumn{ID: key.ID})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue