Commit a68980fb authored by Boris Kocherov's avatar Boris Kocherov

use required html5 attribute

parent 42b8f77d
......@@ -598,8 +598,9 @@
return queue;
}
function render_field(gadget, key, path, json_field, default_value, root, schema_path, type) {
var div,
function render_field(gadget, key, path, json_field, default_value, root, schema_path, options) {
var type,
div,
label,
div_input,
span_info,
......@@ -608,6 +609,9 @@
first_path,
queue = RSVP.Queue();
options = options || {};
type = options.type;
if (path && key) {
first_path = path + encodeJsonPointer(key);
} else {
......@@ -719,6 +723,7 @@
// gadget.props.inputs not contain values
gadget.props.inputs.push(input);
input.name = first_path;
input.required = options.required;
// XXX for gui
//input.setAttribute("class", "slapos-parameter");
div_input.appendChild(input);
......@@ -840,7 +845,7 @@
}
queue
.push(render_field.bind(g, g, key, path,
json_field.properties[key], default_dict[key], root)
json_field.properties[key], default_dict[key], root, schema_path, {required: true})
);
} else if (default_dict.hasOwnProperty(key)) {
used_properties[key] = "";
......@@ -1333,7 +1338,7 @@
root.appendChild(delete_button);
}
return render_field(g, property_name, "", schema,
options.document, root, options.schema_path, options.type)
options.document, root, options.schema_path, {type: options.type})
.push(function () {
g.listenEvents();
return g.element;
......
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