mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 15:40:12 +01:00
🎨 Add multi-select type column to Attribute View https://github.com/siyuan-note/siyuan/issues/8695
This commit is contained in:
parent
7cbd0503fb
commit
2ae3371674
1 changed files with 6 additions and 4 deletions
|
|
@ -337,9 +337,10 @@ func updateAttributeViewColumnOption(operation *Operation) (err error) {
|
||||||
|
|
||||||
colIndex = i
|
colIndex = i
|
||||||
existOpt := false
|
existOpt := false
|
||||||
for _, opt := range col.Options {
|
for j, opt := range col.Options {
|
||||||
if opt.Name == newName {
|
if opt.Name == newName {
|
||||||
existOpt = true
|
existOpt = true
|
||||||
|
col.Options = append(col.Options[:j], col.Options[j+1:]...)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -358,8 +359,8 @@ func updateAttributeViewColumnOption(operation *Operation) (err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, row := range attrView.Rows {
|
for _, row := range attrView.Rows {
|
||||||
for k, cell := range row.Cells {
|
for i, cell := range row.Cells {
|
||||||
if colIndex != k || nil == cell.Value {
|
if colIndex != i || nil == cell.Value {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -371,9 +372,10 @@ func updateAttributeViewColumnOption(operation *Operation) (err error) {
|
||||||
}
|
}
|
||||||
} else if nil != cell.Value.MSelect {
|
} else if nil != cell.Value.MSelect {
|
||||||
existInMSelect := false
|
existInMSelect := false
|
||||||
for _, opt := range cell.Value.MSelect {
|
for j, opt := range cell.Value.MSelect {
|
||||||
if opt.Content == newName {
|
if opt.Content == newName {
|
||||||
existInMSelect = true
|
existInMSelect = true
|
||||||
|
cell.Value.MSelect = append(cell.Value.MSelect[:j], cell.Value.MSelect[j+1:]...)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue