mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
🎨 Improve av https://github.com/siyuan-note/siyuan/issues/14511
This commit is contained in:
parent
4154fd0150
commit
0220f38d94
1 changed files with 2 additions and 17 deletions
|
@ -3964,10 +3964,10 @@ func replaceAttributeViewBlock0(attrView *av.AttributeView, oldBlockID, newBlock
|
||||||
if av.KeyTypeBlock == value.Type {
|
if av.KeyTypeBlock == value.Type {
|
||||||
value.IsDetached = isDetached
|
value.IsDetached = isDetached
|
||||||
if !isDetached {
|
if !isDetached {
|
||||||
if value.Block.ID != newBlockID {
|
if "" != value.Block.ID && value.Block.ID != newBlockID {
|
||||||
unbindBlockAv(tx, avID, value.Block.ID)
|
unbindBlockAv(tx, avID, value.Block.ID)
|
||||||
bindBlockAv(tx, avID, newBlockID)
|
|
||||||
}
|
}
|
||||||
|
bindBlockAv(tx, avID, newBlockID)
|
||||||
|
|
||||||
value.Block.ID = newBlockID
|
value.Block.ID = newBlockID
|
||||||
icon, content := getNodeAvBlockText(node)
|
icon, content := getNodeAvBlockText(node)
|
||||||
|
@ -3983,21 +3983,6 @@ func replaceAttributeViewBlock0(attrView *av.AttributeView, oldBlockID, newBlock
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
replacedRowID := false
|
|
||||||
for _, v := range attrView.Views {
|
|
||||||
for i, itemID := range v.ItemIDs {
|
|
||||||
if itemID == oldBlockID {
|
|
||||||
v.ItemIDs[i] = newBlockID
|
|
||||||
replacedRowID = true
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if !replacedRowID {
|
|
||||||
v.ItemIDs = append(v.ItemIDs, newBlockID)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
regenAttrViewGroups(attrView, "force")
|
regenAttrViewGroups(attrView, "force")
|
||||||
|
|
||||||
changedAvIDs = gulu.Str.RemoveDuplicatedElem(changedAvIDs)
|
changedAvIDs = gulu.Str.RemoveDuplicatedElem(changedAvIDs)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue