mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
🎨 Improve av option editing https://github.com/siyuan-note/siyuan/issues/11484
This commit is contained in:
parent
5dcb82a97c
commit
9048b9e52f
1 changed files with 7 additions and 4 deletions
|
|
@ -3461,13 +3461,16 @@ func updateAttributeViewColumnOption(operation *Operation) (err error) {
|
||||||
|
|
||||||
data := operation.Data.(map[string]interface{})
|
data := operation.Data.(map[string]interface{})
|
||||||
|
|
||||||
oldName := data["oldName"].(string)
|
rename := false
|
||||||
newName := data["newName"].(string)
|
oldName := strings.TrimSpace(data["oldName"].(string))
|
||||||
|
newName := strings.TrimSpace(data["newName"].(string))
|
||||||
|
newDesc := strings.TrimSpace(data["newDesc"].(string))
|
||||||
newColor := data["newColor"].(string)
|
newColor := data["newColor"].(string)
|
||||||
newDesc := data["newDesc"].(string)
|
|
||||||
|
|
||||||
found := false
|
found := false
|
||||||
if oldName != newName {
|
if oldName != newName {
|
||||||
|
rename = true
|
||||||
|
|
||||||
for _, opt := range key.Options {
|
for _, opt := range key.Options {
|
||||||
if newName == opt.Name { // 如果选项已经存在则直接使用
|
if newName == opt.Name { // 如果选项已经存在则直接使用
|
||||||
found = true
|
found = true
|
||||||
|
|
@ -3507,7 +3510,7 @@ func updateAttributeViewColumnOption(operation *Operation) (err error) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if found {
|
if found && rename {
|
||||||
idx := -1
|
idx := -1
|
||||||
for i, opt := range value.MSelect {
|
for i, opt := range value.MSelect {
|
||||||
if oldName == opt.Content {
|
if oldName == opt.Content {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue