Skip to content

Commit

Permalink
Merge branch 'MDL-78288-master' of https://github.com/aanabit/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
sarjona committed Jul 13, 2023
2 parents 844257a + 13857d4 commit 2e78301
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/form/amd/build/collapsesections.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/form/amd/build/collapsesections.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions lib/form/amd/src/collapsesections.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import Pending from 'core/pending';
const SELECTORS = {
FORMHEADER: '.fheader',
FORMCONTAINER: '.fcontainer',
FIELDSET: 'fieldset',
};

const CLASSES = {
Expand Down Expand Up @@ -56,8 +57,8 @@ export const init = collapsesections => {
// Override default collapse class if all visible containers are expanded on page load
let formcontainercount = 0;
$(SELECTORS.FORMCONTAINER).each((_, container) => {
if (!container.classList.contains(CLASSES.HIDDEN) &&
!container.parentElement.classList.contains(CLASSES.HIDDEN)) {
const parentFieldset = container.closest(SELECTORS.FIELDSET);
if (parentFieldset == container.parentElement && !parentFieldset.classList.contains(CLASSES.HIDDEN)) {
formcontainercount++;
}
});
Expand Down

0 comments on commit 2e78301

Please sign in to comment.