diff --git a/backend/web/static/base.js b/backend/web/static/base.js index 79b71d3abbe1d988fe601b82e687a65406d08766..1a08b477e14f80b8ac1d60e3750dcfc2d2a9b268 100644 --- a/backend/web/static/base.js +++ b/backend/web/static/base.js @@ -376,12 +376,12 @@ function getFormElement(node, context) { if (name == 'email' || name == 'traits.email') { var label; - var disable; + var readonly; if (context == 'settings') { - disable = true; + readonly = true; label = 'Changing your e-mail address is not supported at this point.'; } else { - disable = false; + readonly = false; label = 'Please provide your e-mail address. We will send a recovery link to that e-mail address.'; } return getFormInput( @@ -392,7 +392,7 @@ function getFormElement(node, context) { 'Please enter your e-mail address here', label, messages, - disable, + readonly, ); } @@ -494,12 +494,13 @@ function getFormElement(node, context) { // param placeHolder: Label to display in field if empty // param help: Additional help text, displayed below the field in small font // param messages: Message about failed input -function getFormInput(type, name, value, label, placeHolder, help, messages, disable) { +// param readonly: Whether the input should be readonly (defaults to false) +function getFormInput(type, name, value, label, placeHolder, help, messages, readonly) { if (typeof help == 'undefined' || help == null) { help = ''; } - if (typeof disable == 'undefined') { - disable = false; + if (typeof readonly == 'undefined') { + readonly = false; } console.log('Messages: ', messages); @@ -528,8 +529,8 @@ function getFormInput(type, name, value, label, placeHolder, help, messages, dis if (placeHolder) { element += 'placeholder="' + placeHolder + '" '; } - if (disable) { - element += 'disabled '; + if (readonly) { + element += 'readonly '; } element += '>';