We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent db25036 commit d74b255Copy full SHA for d74b255
1 file changed
content/patterns/disclosure/examples/js/disclosure-button.js
@@ -19,7 +19,7 @@ class DisclosureButton {
19
this.buttonNode = buttonNode;
20
this.controlledNode = false;
21
22
- var id = this.buttonNode.getAttribute('aria-controls');
+ const id = this.buttonNode.getAttribute('aria-controls');
23
24
if (id) {
25
this.controlledNode = document.getElementById(id);
@@ -75,13 +75,13 @@ class DisclosureButton {
75
window.addEventListener(
76
'load',
77
function () {
78
- var buttons = document.querySelectorAll(
+ const buttons = document.querySelectorAll(
79
'button[aria-expanded][aria-controls]'
80
);
81
82
- for (var i = 0; i < buttons.length; i++) {
83
- new DisclosureButton(buttons[i]);
84
- }
+ buttons.forEach( (b) => {
+ new DisclosureButton(b);
+ });
85
},
86
false
87
0 commit comments