Commit 1ac6c45c authored by Sven Franck's avatar Sven Franck

fixed display of hidden fields

parent ecf7d9bf
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
"description": "The reference number for this computer.", "description": "The reference number for this computer.",
"description_i18n": "portal_type_dict.computer_dict.field_list.reference.description", "description_i18n": "portal_type_dict.computer_dict.field_list.reference.description",
"alternate_name": "computer_reference", "alternate_name": "computer_reference",
"default_value": null, "default_value": "COMP-1234",
"css_class": null, "css_class": null,
"hidden": false, "hidden": false,
"display_width": 30, "display_width": 30,
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
}, },
"properties": { "properties": {
"enabled": true, "enabled": true,
"editable": true, "editable": false,
"external_validator": null, "external_validator": null,
"required": true, "required": true,
"preserve_whitespace": null, "preserve_whitespace": null,
......
...@@ -42,7 +42,8 @@ ...@@ -42,7 +42,8 @@
}, { }, {
"position": "center", "position": "center",
"fieldlist": [ "fieldlist": [
{"title": "computer_description"} {"title": "computer_description"},
{"title": "computer_reference", "overrides": {"widget":{"hidden": true}}}
] ]
} }
] ]
......
...@@ -867,6 +867,8 @@ ...@@ -867,6 +867,8 @@
} }
// construct config // construct config
// NOTE: type is always set in attributes, because it can be null
// on select/textarea
config.type = element; config.type = element;
config.direct = { config.direct = {
"id": (prevail.widget.id || spec.widget.id), "id": (prevail.widget.id || spec.widget.id),
...@@ -3386,7 +3388,7 @@ ...@@ -3386,7 +3388,7 @@
label_inside, label_target, element_target, action, clear, label_inside, label_target, element_target, action, clear,
theme, icon_string, input_type, need_text_node, container_class_list, theme, icon_string, input_type, need_text_node, container_class_list,
label_class_list, index, disabled, active, text, addLabel, readonly, label_class_list, index, disabled, active, text, addLabel, readonly,
mask_set, mask, star; mask_set, mask, star, hidden_field;
if (config.type === "span") { if (config.type === "span") {
return factory.element( return factory.element(
...@@ -3465,13 +3467,18 @@ ...@@ -3465,13 +3467,18 @@
mask_set = true; mask_set = true;
} }
// hidden
if (config.attributes.type === "hidden") {
hidden_field = true;
}
// mask // mask
if (mask_set) { if (mask_set) {
mask = " ui-mask-input"; mask = " ui-mask-input";
} }
// fieldcontain wrapper // fieldcontain wrapper
if (wrap === false || wrap === undefined) { if (wrap === false || wrap === undefined || hidden_field) {
wrapper = document.createDocumentFragment(); wrapper = document.createDocumentFragment();
} else { } else {
wrapper = factory.element( wrapper = factory.element(
...@@ -3562,7 +3569,7 @@ ...@@ -3562,7 +3569,7 @@
// container // container
if (config.type === "textarea" || if (config.type === "textarea" ||
config.direct.type === "hidden" || hidden_field ||
config.logic.plain_element) { config.logic.plain_element) {
container = wrapper; container = wrapper;
} else { } else {
...@@ -3606,7 +3613,7 @@ ...@@ -3606,7 +3613,7 @@
// doing "invalid" handler with javascript // doing "invalid" handler with javascript
// NOTE: hidden fields & security fields get no label // NOTE: hidden fields & security fields get no label
if (need_text_node === undefined && if (need_text_node === undefined &&
!label_inside && !label_inside && !hidden_field &&
config.logic.plain_element === undefined) { config.logic.plain_element === undefined) {
label_target.appendChild(addLabel(config, label_class_list)); label_target.appendChild(addLabel(config, label_class_list));
} }
......
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