mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-05 10:43:23 +02:00
Minor tweaks
This commit is contained in:
parent
b2e52b5267
commit
04ced13eb6
1 changed files with 18 additions and 9 deletions
|
@ -890,7 +890,7 @@ function hideDeletedForms() {
|
||||||
|
|
||||||
// Update the icon reference to the info icon
|
// Update the icon reference to the info icon
|
||||||
if (parts.length > 1) {
|
if (parts.length > 1) {
|
||||||
parts[1] = "info";
|
parts[1] = "info_outline";
|
||||||
useElement.setAttribute("xlink:href", parts.join("#"));
|
useElement.setAttribute("xlink:href", parts.join("#"));
|
||||||
|
|
||||||
// Change the color to => $dhs-dark-gray-60
|
// Change the color to => $dhs-dark-gray-60
|
||||||
|
@ -938,6 +938,7 @@ function hideDeletedForms() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function showInputOnErrorFields(){
|
function showInputOnErrorFields(){
|
||||||
|
let fullNameButtonClicked = false
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
document.querySelectorAll('[id$="__edit-button"]').forEach(function(button) {
|
document.querySelectorAll('[id$="__edit-button"]').forEach(function(button) {
|
||||||
let fieldIdParts = button.id.split("__")
|
let fieldIdParts = button.id.split("__")
|
||||||
|
@ -947,18 +948,26 @@ function hideDeletedForms() {
|
||||||
let errorMessage = document.querySelector(`#id_${fieldName}__error-message`);
|
let errorMessage = document.querySelector(`#id_${fieldName}__error-message`);
|
||||||
if (errorMessage) {
|
if (errorMessage) {
|
||||||
let nameFields = ["first_name", "middle_name", "last_name"]
|
let nameFields = ["first_name", "middle_name", "last_name"]
|
||||||
|
|
||||||
|
button.click()
|
||||||
|
|
||||||
// If either the full_name field errors out,
|
// If either the full_name field errors out,
|
||||||
// or if any of its associated fields do - show all name related fields.
|
// or if any of its associated fields do - show all name related fields.
|
||||||
// Otherwise, just show the problematic field.
|
// Otherwise, just show the problematic field.
|
||||||
if (fieldName == "full_name"){
|
if (nameFields.includes(fieldName) && !fullNameButtonClicked){
|
||||||
handleFullNameField(fieldName);
|
fullNameButton = document.querySelector("#full_name__edit-button")
|
||||||
}else if (nameFields.includes(fieldName)){
|
if (fullNameButton) {
|
||||||
handleFullNameField("full_name");
|
fullNameButton.click()
|
||||||
button.click()
|
fullNameButtonClicked = true
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
button.click()
|
let readonlyId = getReadonlyFieldId("full_name");
|
||||||
|
let readonlyField = document.querySelector(readonlyId);
|
||||||
|
if (readonlyField) {
|
||||||
|
readonlyField.classList.toggle("overlapped-full-name-field");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue