Skip to content
Snippets Groups Projects
Commit 368c45b0 authored by Arie Peterson's avatar Arie Peterson
Browse files

Use readonly instead of disabled for email input in settings

parent ac4f32cd
No related branches found
No related tags found
1 merge request!111Resolve "No feedback when saving profile settings"
Pipeline #39129 passed with stages
in 3 minutes and 11 seconds
......@@ -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 += '>';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment