Skip to content

Commit

Permalink
fix(index): resolve target before use
Browse files Browse the repository at this point in the history
crsten committed Sep 16, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent c7b91d0 commit 68a7130
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/godfather.js

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

5 changes: 4 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -153,7 +153,10 @@ function init(entry) {
}

function destroy(entry) {
if (entry.target) entry.target.classList.remove('godfather--active')
if (entry.target) {
let target = resolveTarget(entry)
if (target) target.classList.remove('godfather--active')
}
if (entry.popper) entry.popper.destroy()
if (entry.options.overlay) removeOverlay(entry)
if (entry.clickAway) window.removeEventListener('click', entry.clickAway)

0 comments on commit 68a7130

Please sign in to comment.