add detail style and hide fed agency

This commit is contained in:
zandercymatics 2024-09-25 15:29:40 -06:00
parent 7b2b4f0401
commit 2430d3ecf6
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
2 changed files with 9 additions and 8 deletions

View file

@ -883,22 +883,22 @@ function initializeWidgetOnList(list, parentId) {
// Handle hiding the organization name field when the organization_type is federal. // Handle hiding the organization name field when the organization_type is federal.
// Run this first one page load, then secondly on a change event. // Run this first one page load, then secondly on a change event.
let organizationNameContainer = document.querySelector(".field-organization_name"); let organizationNameContainer = document.querySelector(".field-organization_name");
if (!organizationNameContainer) { let federalType = document.querySelector(".field-federal_type");
organizationNameContainer = document.querySelector("#id_organization_name"); handleOrganizationTypeChange(organizationType, organizationNameContainer, federalType);
}
handleOrganizationTypeChange(organizationType, organizationNameContainer);
organizationType.addEventListener("change", function() { organizationType.addEventListener("change", function() {
handleOrganizationTypeChange(organizationType, organizationNameContainer); handleOrganizationTypeChange(organizationType, organizationNameContainer, federalType);
}); });
}); });
function handleOrganizationTypeChange(organizationType, organizationNameContainer) { function handleOrganizationTypeChange(organizationType, organizationNameContainer, federalType) {
if (organizationType && organizationNameContainer) { if (organizationType && organizationNameContainer && federalType) {
let selectedValue = organizationType.value; let selectedValue = organizationType.value;
if (selectedValue === "federal") { if (selectedValue === "federal") {
hideElement(organizationNameContainer); hideElement(organizationNameContainer);
showElement(federalType);
} else { } else {
showElement(organizationNameContainer); showElement(organizationNameContainer);
hideElement(federalType);
} }
} }
} }

View file

@ -453,7 +453,8 @@ details.dja-detail-table {
background-color: var(--body-bg); background-color: var(--body-bg);
.dja-details-summary { .dja-details-summary {
cursor: pointer; cursor: pointer;
color: var(--body-quiet-color); color: var(--link-fg);
text-decoration: underline;
} }
@media (max-width: 1024px){ @media (max-width: 1024px){