mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-04 15:58:49 +01:00
🎨 Update attr panel for av
This commit is contained in:
parent
d257caff8d
commit
1590913db7
2 changed files with 8 additions and 5 deletions
|
|
@ -8,6 +8,9 @@ import {popTextCell} from "./cell";
|
|||
export const genAVValueHTML = (value: IAVCellValue) => {
|
||||
let html = "";
|
||||
switch (value.type) {
|
||||
case "block":
|
||||
html = `<div class="fn__flex-1">${value.block.content}</div>`;
|
||||
break;
|
||||
case "text":
|
||||
html = `<textarea rows="${value.text.content.split("\n").length}" class="b3-text-field b3-text-field--text fn__flex-1">${value.text.content}</textarea>`;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue