Skip to content

Commit

Permalink
add escape event handler to call the close api
Browse files Browse the repository at this point in the history
  • Loading branch information
cyan33 committed Oct 1, 2017
1 parent abaa43e commit 70b8e92
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions zoomerang.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,9 @@

overlay.addEventListener('click', api.close)
wrapper.addEventListener('click', api.close)
window.addEventListener('keydown', function(e) {
if (e.keyCode === 27) api.close()
})

// umd expose
if (typeof exports == "object") {
Expand Down

0 comments on commit 70b8e92

Please sign in to comment.