The status changelog logic got removed when shuffling functions. Refer to old commit
This commit is contained in:
zandercymatics 2024-06-14 13:50:28 -06:00
parent 51b89e4604
commit 0121198f57
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7

View file

@ -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