forked from MapComplete/MapComplete
Small fixes to OH visualization
This commit is contained in:
parent
4db1997ed6
commit
c9478c100a
5 changed files with 55 additions and 13 deletions
|
@ -4,13 +4,26 @@ import {UIEventSource} from "../Logic/UIEventSource";
|
|||
|
||||
export default class SpecialVisualizations {
|
||||
|
||||
public static specialVisualizations: { funcName: string, constr: ((tagSource: UIEventSource<any>, argument: string) => UIElement) }[] =
|
||||
public static specialVisualizations: {
|
||||
funcName: string,
|
||||
constr: ((tagSource: UIEventSource<any>, argument: string[]) => UIElement),
|
||||
docs: string,
|
||||
args: {name: string, defaultValue: string, doc: string}[]
|
||||
}[] =
|
||||
|
||||
[{
|
||||
funcName: "opening_hours_table",
|
||||
constr: (tagSource: UIEventSource<any>, keyname) => {
|
||||
docs: "Creates an opening-hours table. Usage: {opening_hours_table(opening_hours)} to create a table of the tag 'opening_hours'.",
|
||||
args:[{name:"key", defaultValue: "opening_hours", doc: "The tag from which the table is constructed"}],
|
||||
constr: (tagSource: UIEventSource<any>, args) => {
|
||||
let keyname = args[0];
|
||||
if (keyname === undefined || keyname === "") {
|
||||
keyname = keyname ?? "opening_hours"
|
||||
}
|
||||
return new OpeningHoursVisualization(tagSource, keyname)
|
||||
}
|
||||
}]
|
||||
},
|
||||
|
||||
]
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue