Commit 473098ac authored by Boris Kocherov's avatar Boris Kocherov

UI: do not display label for form. display title instead

parent 5ba4e004
...@@ -538,6 +538,7 @@ ...@@ -538,6 +538,7 @@
div, div,
delete_button, delete_button,
label, label,
label_text,
div_input, div_input,
span_info, span_info,
error_message, error_message,
...@@ -606,16 +607,24 @@ ...@@ -606,16 +607,24 @@
label.value = key; label.value = key;
gadget.props.property_name_edit = label; gadget.props.property_name_edit = label;
} else { } else {
label = document.createElement("label"); label_text = [key, json_field.title]
label.textContent = [key, json_field.title]
.filter(function (v) { return v; }) .filter(function (v) { return v; })
.join(" ") .join(" ")
// use non-breaking hyphen // use non-breaking hyphen
.replace("-", ""); .replace(/-/g, "");
} if (label_text) {
if (label.textContent) { if (options.top) {
label = document.createElement("span");
label.textContent = label_text;
root.appendChild(label);
} else {
label = document.createElement("label");
label.textContent = label_text;
div.appendChild(label); div.appendChild(label);
} }
}
}
div_input = document.createElement("div"); div_input = document.createElement("div");
div_input.setAttribute("id", gadget.element.getAttribute("data-gadget-scope") + first_path + '/'); div_input.setAttribute("id", gadget.element.getAttribute("data-gadget-scope") + first_path + '/');
div_input.setAttribute("class", "input"); div_input.setAttribute("class", "input");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment