Skip to content

Commit

Permalink
Fixing issue with the is-required class firstly should be removed dep…
Browse files Browse the repository at this point in the history
…ending on the given argument list and only then added.
  • Loading branch information
EddiTim committed Jul 2, 2024
1 parent 89fb490 commit 9650980
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config/htdocs/static/setServiceType.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ function disableElements(disabled, ...elementIds) {
const disabledForLoan = ['copyrightType', 'titleOfComponent', 'authorOfComponent', 'volume', 'issue', 'pagesRequested'];

function changeForm(firstTry, required, notRequired, fieldsDisabled, copyDivOpacity, titleLabel, npl) {
addClassToElements('is-required', ...Object.keys(required).map(x => `div-${x}`));
removeClassFromElements('is-required', ...Object.keys(notRequired).map(x => `div-${x}`));
addClassToElements('is-required', ...Object.keys(required).map(x => `div-${x}`));
if (npl) removeClassFromElements('is-required', 'div-pickupLocation');

disableElements(fieldsDisabled, ...disabledForLoan);
Expand Down

0 comments on commit 9650980

Please sign in to comment.