Skip to content

Commit

Permalink
Move function declaration outside of condition
Browse files Browse the repository at this point in the history
  • Loading branch information
KittyGiraudel committed Feb 15, 2021
1 parent ffe718c commit 61069a4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions a11y-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -463,15 +463,15 @@
return siblings
}

function instantiateDialogs() {
$$('[data-a11y-dialog]').forEach(function (node) {
new A11yDialog(node, node.getAttribute('data-a11y-dialog') || undefined)
})
}

if (typeof global.document !== 'undefined') {
var document = global.document

function instantiateDialogs() {
$$('[data-a11y-dialog]').forEach(function (node) {
new A11yDialog(node, node.getAttribute('data-a11y-dialog') || undefined)
})
}

if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', instantiateDialogs)
} else {
Expand Down
12 changes: 6 additions & 6 deletions example/a11y-dialog.js

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

0 comments on commit 61069a4

Please sign in to comment.