Skip to content

Commit

Permalink
chore: use addEventListener instead of addListener (eslint#15923)
Browse files Browse the repository at this point in the history
Use addEventListener() instead of matchMedia().addListener() since matchMedia().addListener() is deprecated.
  • Loading branch information
amareshsm authored and srijan-deepsource committed May 30, 2022
1 parent f491660 commit a5ffdfe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/src/assets/js/components-index.js
Expand Up @@ -6,7 +6,7 @@

if (matchMedia) {
const mq = window.matchMedia("(max-width: 1023px)");
mq.addListener(WidthChange);
mq.addEventListener('change', WidthChange);
WidthChange(mq);
}

Expand Down
6 changes: 3 additions & 3 deletions docs/src/assets/js/main.js
Expand Up @@ -6,7 +6,7 @@

if (toc && matchMedia) {
const mq = window.matchMedia("(max-width: 1023px)");
mq.addListener(WidthChange);
mq.addEventListener('change', WidthChange);
WidthChange(mq);
}

Expand Down Expand Up @@ -53,7 +53,7 @@

if (matchMedia) {
const mq = window.matchMedia("(max-width: 1023px)");
mq.addListener(WidthChange);
mq.addEventListener('change', WidthChange);
WidthChange(mq);
}

Expand Down Expand Up @@ -93,7 +93,7 @@

if (matchMedia) {
const mq = window.matchMedia("(max-width: 1023px)");
mq.addListener(WidthChange);
mq.addEventListener('change', WidthChange);
WidthChange(mq);
}

Expand Down

0 comments on commit a5ffdfe

Please sign in to comment.