Add 'title()' builtin, which can be used as stopgap for some reused questions
This commit is contained in:
parent
92f5b57c9f
commit
84e72fe622
1 changed files with 14 additions and 0 deletions
|
@ -859,6 +859,20 @@ export default class SpecialVisualizations {
|
|||
isUploading), t.loginToAddPicture, state)
|
||||
}
|
||||
|
||||
},
|
||||
{
|
||||
funcName:"title",
|
||||
args: [],
|
||||
docs:"Shows the title of the popup. Useful for some cases, e.g. 'What is phone number of {title()}?'",
|
||||
example:"`What is the phone number of {title()}`, which might automatically become `What is the phone number of XYZ`.",
|
||||
constr: (state, tags, args, guistate) =>
|
||||
new VariableUiElement(tags.map(tags => {
|
||||
const layer = state.layoutToUse.getMatchingLayer(tags)
|
||||
console.log("Layer for tags", tags,"is", layer.id)
|
||||
const title = layer?.title?.GetRenderValue(tags)
|
||||
console.log("Title became: ", title)
|
||||
return title
|
||||
}))
|
||||
}
|
||||
]
|
||||
|
||||
|
|
Loading…
Reference in a new issue