Remove unused code for changing required attributes

This commit is contained in:
Matt-Yorkley
2021-12-20 17:29:36 +00:00
parent 723d6489cd
commit b4dab46cf8
2 changed files with 2 additions and 54 deletions

View File

@@ -29,11 +29,9 @@ export default class extends Controller {
).forEach((e) => {
if (e.id === paymentMethodContainerId) {
e.style.display = "block";
this.addRequiredAttributeOnInputIfNeeded(e);
this.removeDisabledAttributeOnInput(e);
} else {
e.style.display = "none";
this.removeRequiredAttributeOnInput(e);
this.addDisabledAttributeOnInput(e);
}
});
@@ -54,21 +52,4 @@ export default class extends Controller {
i.disabled = false;
});
}
removeRequiredAttributeOnInput(container) {
this.getFormElementsArray(container).forEach((i) => {
if (i.required) {
i.dataset.required = i.required;
i.required = false;
}
});
}
addRequiredAttributeOnInputIfNeeded(container) {
this.getFormElementsArray(container).forEach((i) => {
if (i.dataset.required === "true") {
i.required = true;
}
});
}
}