mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-04 00:42:16 +02:00
Fix bug
The status changelog logic got removed when shuffling functions. Refer to old commit
This commit is contained in:
parent
51b89e4604
commit
0121198f57
1 changed files with 24 additions and 0 deletions
|
@ -360,6 +360,30 @@ function initializeWidgetOnList(list, parentId) {
|
|||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue