Skip to content

Commit

Permalink
Rename checkIfAllSectionsOpen to areAllSectionsOpen
Browse files Browse the repository at this point in the history
  • Loading branch information
36degrees committed Jun 4, 2024
1 parent 0ebf39f commit bb3c8bc
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export class Accordion extends GOVUKFrontendComponent {
this.initControls()
this.initSectionHeaders()

this.updateShowAllButton(this.checkIfAllSectionsOpen())
this.updateShowAllButton(this.areAllSectionsOpen())
}

/**
Expand Down Expand Up @@ -388,7 +388,7 @@ export class Accordion extends GOVUKFrontendComponent {
* @private
*/
onShowOrHideAllToggle() {
const nowExpanded = !this.checkIfAllSectionsOpen()
const nowExpanded = !this.areAllSectionsOpen()

this.$sections.forEach(($section) => {
this.setExpanded(nowExpanded, $section)
Expand Down Expand Up @@ -471,7 +471,7 @@ export class Accordion extends GOVUKFrontendComponent {
}

// See if "Show all sections" button text should be updated
this.updateShowAllButton(this.checkIfAllSectionsOpen())
this.updateShowAllButton(this.areAllSectionsOpen())
}

/**
Expand All @@ -491,7 +491,7 @@ export class Accordion extends GOVUKFrontendComponent {
* @private
* @returns {boolean} True if all sections are open
*/
checkIfAllSectionsOpen() {
areAllSectionsOpen() {
return Array.from(this.$sections).every(($section) =>
this.isExpanded($section)
)
Expand Down

0 comments on commit bb3c8bc

Please sign in to comment.