🎨 Update attr panel for av

This commit is contained in:
Daniel 2023-10-12 19:55:57 +08:00
parent d257caff8d
commit 1590913db7
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
2 changed files with 8 additions and 5 deletions

View file

@ -123,10 +123,6 @@ func GetBlockAttributeViewKeys(blockID string) (ret []*BlockAttributeViewKeys) {
var keyValues []*av.KeyValues
for _, kv := range attrView.KeyValues {
if av.KeyTypeBlock == kv.Key.Type {
continue
}
kValues := &av.KeyValues{Key: kv.Key}
for _, v := range kv.Values {
if v.BlockID == blockID {
@ -180,7 +176,11 @@ func GetBlockAttributeViewKeys(blockID string) (ret []*BlockAttributeViewKeys) {
switch kv.Key.Type {
case av.KeyTypeTemplate:
if 0 < len(kv.Values) {
ial := GetBlockAttrs(blockID)
ial := map[string]string{}
block := getRowBlockValue(keyValues)
if !block.IsDetached {
ial = GetBlockAttrs(blockID)
}
kv.Values[0].Template.Content = renderTemplateCol(ial, kv.Key.Template, keyValues)
}
}