Skip to content

Commit

Permalink
fix #35
Browse files Browse the repository at this point in the history
nkappler committed Jun 14, 2022
1 parent bdc40a2 commit d3b22db
Showing 5 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -141,6 +141,9 @@ var styles = 'html{min-height:100%}.ctxmenu{position:fixed;max-height:100vh;bord
}), {
passive: true
});
window.addEventListener("keydown", (function(e) {
if ("Escape" === e.key) _this.hide();
}));
ContextMenu.addStylesToDom();
}
ContextMenu.getInstance = function() {
2 changes: 1 addition & 1 deletion index.min.js

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

3 changes: 3 additions & 0 deletions src/ctxmenu.ts
Original file line number Diff line number Diff line change
@@ -53,6 +53,9 @@ class ContextMenu implements CTXMenuSingleton {
this.hide();
});
}, { passive: true });
window.addEventListener("keydown", e => {
if (e.key === "Escape") this.hide();
});
ContextMenu.addStylesToDom();
}

3 changes: 3 additions & 0 deletions standalone/ctxmenu.js
Original file line number Diff line number Diff line change
@@ -123,6 +123,9 @@
}), {
passive: true
});
window.addEventListener("keydown", (function(e) {
if ("Escape" === e.key) _this.hide();
}));
ContextMenu.addStylesToDom();
}
ContextMenu.getInstance = function() {
2 changes: 1 addition & 1 deletion standalone/ctxmenu.min.js

0 comments on commit d3b22db

Please sign in to comment.