Adding an "enabled" attribute to templates

This commit is contained in:
Zef Hemel
2024-01-11 14:06:24 +01:00
parent 154d9a8ce9
commit 509ece91f0
9 changed files with 43 additions and 11 deletions
+7 -2
View File
@@ -326,12 +326,17 @@ function render(
};
case "CommandLink": {
// Child 0 is CommandLinkMark, child 1 is CommandLinkPage
const commandText = t.children![1].children![0].text!;
const command = t.children![1].children![0].text!;
let commandText = command;
const aliasNode = findNodeOfType(t, "CommandLinkAlias");
if (aliasNode) {
commandText = aliasNode.children![0].text!;
}
return {
name: "button",
attrs: {
"data-onclick": JSON.stringify(["command", commandText]),
"data-onclick": JSON.stringify(["command", command]),
},
body: commandText,
};