mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 07:30:12 +01:00
🎨 Improve av https://github.com/siyuan-note/siyuan/issues/14511
This commit is contained in:
parent
0deda92cac
commit
a0e98ea35d
2 changed files with 11 additions and 11 deletions
|
|
@ -565,17 +565,19 @@ func (av *AttributeView) GetCurrentView(viewID string) (ret *View, err error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (av *AttributeView) ExistBlock(blockID string) bool {
|
func (av *AttributeView) ExistBlock(blockID string) bool {
|
||||||
for _, kv := range av.KeyValues {
|
for _, blockVal := range av.GetBlockKeyValues().Values {
|
||||||
if KeyTypeBlock != kv.Key.Type {
|
if blockVal.BlockID == blockID {
|
||||||
continue
|
return true
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
for _, v := range kv.Values {
|
func (av *AttributeView) ExistBoundBlock(nodeID string) bool {
|
||||||
if v.BlockID == blockID {
|
for _, blockVal := range av.GetBlockKeyValues().Values {
|
||||||
return true
|
if blockVal.Block.ID == nodeID {
|
||||||
}
|
return true
|
||||||
}
|
}
|
||||||
return false
|
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1289,9 +1289,7 @@ func GetBlockAttributeViewKeys(blockID string) (ret []*BlockAttributeViewKeys) {
|
||||||
attrViewCache[avID] = attrView
|
attrViewCache[avID] = attrView
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO 待测试
|
if !attrView.ExistBoundBlock(blockID) {
|
||||||
|
|
||||||
if !attrView.ExistBlock(blockID) {
|
|
||||||
// 比如剪切后粘贴,块 ID 会变,但是属性还在块上,这里做一次数据订正
|
// 比如剪切后粘贴,块 ID 会变,但是属性还在块上,这里做一次数据订正
|
||||||
// Auto verify the database name when clicking the block superscript icon https://github.com/siyuan-note/siyuan/issues/10861
|
// Auto verify the database name when clicking the block superscript icon https://github.com/siyuan-note/siyuan/issues/10861
|
||||||
unbindBlockAv(nil, avID, blockID)
|
unbindBlockAv(nil, avID, blockID)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue