mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-27 13:06:30 +02:00
Update portfolio-member-page.js
This commit is contained in:
parent
0f1509fe73
commit
c0b68eebe8
1 changed files with 6 additions and 1 deletions
|
@ -215,14 +215,19 @@ export function initPortfolioMemberPage() {
|
||||||
// The dom will include these elements when this occurs.
|
// The dom will include these elements when this occurs.
|
||||||
// NOTE: This logic does not trigger when the user is the ONLY admin in the portfolio.
|
// NOTE: This logic does not trigger when the user is the ONLY admin in the portfolio.
|
||||||
// This is because info alerts are used rather than modals in this case.
|
// This is because info alerts are used rather than modals in this case.
|
||||||
if (memberForm && editSelfWarningModal && editSelfWarningModalConfirm) {
|
if (memberForm && editSelfWarningModal) {
|
||||||
|
console.log("Test")
|
||||||
// Only show the warning modal when the user is changing their ROLE.
|
// Only show the warning modal when the user is changing their ROLE.
|
||||||
var canSubmit = document.querySelector(`input[name="role"]:checked`)?.value != "organization_member";
|
var canSubmit = document.querySelector(`input[name="role"]:checked`)?.value != "organization_member";
|
||||||
|
console.log("can submit")
|
||||||
|
console.log(canSubmit)
|
||||||
let radioButtons = document.querySelectorAll(`input[name="role"]`);
|
let radioButtons = document.querySelectorAll(`input[name="role"]`);
|
||||||
radioButtons.forEach(function (radioButton) {
|
radioButtons.forEach(function (radioButton) {
|
||||||
radioButton.addEventListener("change", function() {
|
radioButton.addEventListener("change", function() {
|
||||||
selectedValue = radioButton.checked ? radioButton.value : null;
|
selectedValue = radioButton.checked ? radioButton.value : null;
|
||||||
canSubmit = selectedValue != "organization_member";
|
canSubmit = selectedValue != "organization_member";
|
||||||
|
console.log("selected value")
|
||||||
|
console.log(selectedValue)
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue