Skip to content

Commit f688c69

Browse files
committed
Remove IE compatibility comments from JS
1 parent 993148f commit f688c69

13 files changed

+10
-21
lines changed

demos/accordion/index-aria.html

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@
2222
var headers = document.querySelectorAll(".accordionHeader");
2323
for (var i = 0; i < headers.length; i++) {
2424
headers[i].addEventListener('click',function () {
25-
/* IE11+ support - otherwise, use classic getAttribute/setAttribute */
2625
var p = this.getAttribute("aria-controls");
27-
document.getElementById(p).classList.toggle("open"); /* IE10+ support only - otherwise, use more verbose method to setting/unsetting class */
26+
document.getElementById(p).classList.toggle("open");
2827
if (this.getAttribute('aria-expanded') === "false") {
2928
this.setAttribute('aria-expanded', "true");
3029
} else {

demos/accordion/index.html

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@
2222
var headers = document.querySelectorAll(".accordionHeader");
2323
for (var i = 0; i < headers.length; i++) {
2424
headers[i].addEventListener('click',function () {
25-
/* IE11+ support - otherwise, use classic getAttribute/setAttribute */
2625
var p = this.dataset.expand;
27-
document.getElementById(p).classList.toggle("open"); /* IE10+ support only - otherwise, use more verbose method to setting/unsetting class */
26+
document.getElementById(p).classList.toggle("open");
2827
this.classList.toggle("open");
2928
});
3029
}

demos/checkbox/index-aria.html

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
for (var i = 0; i < checkboxes.length; i++) {
4141
checkboxes[i].addEventListener('click',function () {
4242
/* note that aria boolean attributes are still *strings*, so can't use boolean logic */
43-
/* IE11+ support - otherwise, use classic getAttribute/setAttribute */
4443
if (this.getAttribute('aria-checked') === "true") {
4544
this.setAttribute('aria-checked',"false");
4645
} else {

demos/checkbox/index.html

+1-2
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,8 @@
3737
var checkboxes = document.querySelectorAll(".checkbox");
3838
for (var i = 0; i < checkboxes.length; i++) {
3939
checkboxes[i].addEventListener('click',function () {
40-
this.classList.toggle("checked"); /* IE10+ support only - otherwise, use more verbose method to setting/unsetting class */
40+
this.classList.toggle("checked");
4141
/* note that dataset boolean attributes are still *strings*, so can't use boolean logic */
42-
/* IE11+ support - otherwise, use classic getAttribute/setAttribute */
4342
if (this.dataset.checked === "true") {
4443
this.dataset.checked = "false";
4544
} else {

demos/disclosure/index-aria-menu.html

+1-2
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@
2525
window.addEventListener('load',function() {
2626
var b = document.getElementById("b");
2727
b.addEventListener('click',function () {
28-
/* IE11+ support - otherwise, use classic getAttribute/setAttribute */
2928
var p = this.getAttribute('aria-controls');
30-
document.getElementById(p).classList.toggle("show"); /* IE10+ support only - otherwise, use more verbose method to setting/unsetting class */
29+
document.getElementById(p).classList.toggle("show");
3130
if (this.getAttribute('aria-expanded') === "false") {
3231
this.setAttribute('aria-expanded', "true");
3332
} else {

demos/disclosure/index-aria.html

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@
2121
window.addEventListener('load',function() {
2222
var b = document.getElementById("b");
2323
b.addEventListener('click',function () {
24-
/* IE11+ support - otherwise, use classic getAttribute/setAttribute */
2524
var p = this.getAttribute('aria-controls');
26-
document.getElementById(p).classList.toggle("show"); /* IE10+ support only - otherwise, use more verbose method to setting/unsetting class */
25+
document.getElementById(p).classList.toggle("show");
2726
if (this.getAttribute('aria-expanded') === "false") {
2827
this.setAttribute('aria-expanded', "true");
2928
} else {

demos/disclosure/index.html

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@
2121
window.addEventListener('load',function() {
2222
var b = document.getElementById("b");
2323
b.addEventListener('click',function () {
24-
/* IE11+ support - otherwise, use classic getAttribute/setAttribute */
2524
var p = this.dataset.expand;
26-
document.getElementById(p).classList.toggle("show"); /* IE10+ support only - otherwise, use more verbose method to setting/unsetting class */
25+
document.getElementById(p).classList.toggle("show");
2726
this.classList.toggle("toggled");
2827
});
2928
})

demos/radio/index-aria.html

-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
for (var i = 0; i < radios.length; i++) {
3535
radios[i].addEventListener('click',function () {
3636
/* note that dataset boolean attributes are still *strings*, so can't use boolean logic */
37-
/* IE11+ support - otherwise, use classic getAttribute/setAttribute */
38-
3937
/* if the radio button isn't already checked */
4038
if (this.getAttribute("aria-checked") === "false") {
4139
/* loop through all radio buttons and make sure they're not checked */

demos/radio/index.html

-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
for (var i = 0; i < radios.length; i++) {
3535
radios[i].addEventListener('click',function () {
3636
/* note that dataset boolean attributes are still *strings*, so can't use boolean logic */
37-
/* IE11+ support - otherwise, use classic getAttribute/setAttribute */
38-
3937
/* if the radio button isn't already checked */
4038
if (this.dataset.checked === "false") {
4139
/* loop through all radio buttons and make sure they're not checked */

demos/toggle/index-aria-css-namechange.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
this.querySelector(".label").innerHTML = "Unmute";
2323
}
2424

25-
this.classList.toggle("toggled"); /* IE10+ support only - otherwise, use more verbose method to setting/unsetting class */
25+
this.classList.toggle("toggled");
2626
});
2727
})
2828
</script>

demos/toggle/index-aria.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
} else {
1919
this.setAttribute('aria-pressed', "true");
2020
}
21-
this.classList.toggle("toggled"); /* IE10+ support only - otherwise, use more verbose method to setting/unsetting class */
21+
this.classList.toggle("toggled");
2222
});
2323
})
2424
</script>

demos/toggle/index-namechange.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
this.querySelector(".label").innerHTML = "Unmute";
2020
}
2121

22-
this.classList.toggle("toggled"); /* IE10+ support only - otherwise, use more verbose method to setting/unsetting class */
22+
this.classList.toggle("toggled");
2323
});
2424
})
2525
</script>

demos/toggle/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
window.addEventListener('load',function() {
1313
var b = document.getElementById("b");
1414
b.addEventListener('click',function () {
15-
this.classList.toggle("toggled"); /* IE10+ support only - otherwise, use more verbose method to setting/unsetting class */
15+
this.classList.toggle("toggled");
1616
});
1717
})
1818
</script>

0 commit comments

Comments
 (0)