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,15 +607,23 @@ ...@@ -606,15 +607,23 @@
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(/-/g, "");
.replace("-", ""); if (label_text) {
} if (options.top) {
if (label.textContent) { label = document.createElement("span");
div.appendChild(label); label.textContent = label_text;
root.appendChild(label);
} else {
label = document.createElement("label");
label.textContent = label_text;
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 + '/');
......
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