Improve form rendering for part parameter template

This commit is contained in:
Oliver Walters 2022-03-18 23:20:53 +11:00
parent 807dfebb03
commit 335f0ceb79

View File

@ -312,7 +312,13 @@ function renderPartCategory(name, data, parameters, options) {
// eslint-disable-next-line no-unused-vars
function renderPartParameterTemplate(name, data, parameters, options) {
var html = `<span>${data.name} - [${data.units}]</span>`;
var units = '';
if (data.units) {
units = ` [${data.units}]`;
}
var html = `<span>${data.name}${units}</span>`;
return html;
}