summaryrefslogtreecommitdiffstats
path: root/install/ui/src/freeipa/widget.js
diff options
context:
space:
mode:
Diffstat (limited to 'install/ui/src/freeipa/widget.js')
-rw-r--r--install/ui/src/freeipa/widget.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/install/ui/src/freeipa/widget.js b/install/ui/src/freeipa/widget.js
index 9ea5ea0e0..b3ea3a838 100644
--- a/install/ui/src/freeipa/widget.js
+++ b/install/ui/src/freeipa/widget.js
@@ -1838,14 +1838,26 @@ IPA.boolean_formatter = function(spec) {
that.show_false = spec.show_false;
/** Parse return inverted value */
that.invert_value = spec.invert_value;
+ /**
+ * Result of parse of `undefined` or `null` value will be `empty_value`
+ * if set.
+ * @property {boolean|undefined}
+ */
+ that.empty_value = spec.empty_value;
/**
* Convert string boolean value into real boolean value, or keep
* the original value
+ *
+ * @param {Mixed} value Value to parse
+ * @return {boolean|""}
*/
that.parse = function(value) {
- if (value === undefined || value === null) return '';
+ if (value === undefined || value === null) {
+ if (that.empty_value !== undefined) value = that.empty_value;
+ else return '';
+ }
if (value instanceof Array) {
value = value[0];