Replace choices/default placeholders in JS client

pull/139/head
Piero Toffanin 2020-12-18 16:26:23 -05:00
rodzic 81059d24b9
commit 905e66d9ef
1 zmienionych plików z 7 dodań i 0 usunięć

Wyświetl plik

@ -494,6 +494,13 @@ $(function() {
}else if (properties.type === 'enum'){
this.defaultValue = properties.value;
}
if (this.properties.help){
var choicesStr = typeof domain === "object" ? domain.join(", ") : domain;
this.properties.help = this.properties.help.replace(/\%\(choices\)s/g, choicesStr);
this.properties.help = this.properties.help.replace(/\%\(default\)s/g, this.properties.value);
}
this.value = ko.observable(this.defaultValue);
}