forked from MapComplete/MapComplete
Docs: add stack offset for featureSwitches and booleanSwitch
This commit is contained in:
parent
9d23f80539
commit
5269481afc
3 changed files with 21 additions and 24 deletions
|
@ -17,14 +17,17 @@ export class QueryParameters {
|
|||
public static GetQueryParameter(
|
||||
key: string,
|
||||
deflt: string,
|
||||
documentation?: string
|
||||
documentation?: string,
|
||||
options?: {
|
||||
stackOffset?: number
|
||||
}
|
||||
): UIEventSource<string> {
|
||||
if (!this.initialized) {
|
||||
this.init()
|
||||
}
|
||||
|
||||
if (Utils.runningFromConsole) {
|
||||
const location = Utils.getLocationInCode(-1)
|
||||
const location = Utils.getLocationInCode(-1 + (options?.stackOffset ?? 0))
|
||||
|
||||
documentation +=
|
||||
"\n\nThis documentation is defined in the source code at [" +
|
||||
|
@ -63,7 +66,7 @@ export class QueryParameters {
|
|||
documentation?: string
|
||||
): UIEventSource<boolean> {
|
||||
return UIEventSource.asBoolean(
|
||||
QueryParameters.GetQueryParameter(key, "" + deflt, documentation)
|
||||
QueryParameters.GetQueryParameter(key, "" + deflt, documentation, {stackOffset: -1})
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue