mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-25 20:18:38 +02:00
Merge remote-tracking branch 'origin/main' into nl/2248-add-org-and-portfolio-table
This commit is contained in:
commit
4831e93f3c
1 changed files with 24 additions and 0 deletions
|
@ -401,6 +401,30 @@ function initializeWidgetOnList(list, parentId) {
|
||||||
sessionStorage.removeItem(name);
|
sessionStorage.removeItem(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
let statusSelect = document.getElementById('id_status');
|
||||||
|
|
||||||
|
function moveStatusChangelog(actionNeededReasonFormGroup, statusSelect) {
|
||||||
|
let flexContainer = actionNeededReasonFormGroup.querySelector('.flex-container');
|
||||||
|
let statusChangelog = document.getElementById('dja-status-changelog');
|
||||||
|
if (statusSelect.value === "action needed") {
|
||||||
|
flexContainer.parentNode.insertBefore(statusChangelog, flexContainer.nextSibling);
|
||||||
|
} else {
|
||||||
|
// Move the changelog back to its original location
|
||||||
|
let statusFlexContainer = statusSelect.closest('.flex-container');
|
||||||
|
statusFlexContainer.parentNode.insertBefore(statusChangelog, statusFlexContainer.nextSibling);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Call the function on page load
|
||||||
|
moveStatusChangelog(actionNeededReasonFormGroup, statusSelect);
|
||||||
|
|
||||||
|
// Add event listener to handle changes to the selector itself
|
||||||
|
statusSelect.addEventListener('change', function() {
|
||||||
|
moveStatusChangelog(actionNeededReasonFormGroup, statusSelect);
|
||||||
|
})
|
||||||
|
});
|
||||||
})();
|
})();
|
||||||
|
|
||||||
/** An IIFE for toggling the submit bar on domain request forms
|
/** An IIFE for toggling the submit bar on domain request forms
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue