Skip to content

Commit

Permalink
chore: close notification via Esc key
Browse files Browse the repository at this point in the history
  • Loading branch information
grdddj committed Sep 9, 2024
1 parent fd7926d commit 8f87dd4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/dashboard/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ const app = createApp({
this.$nextTick(() => {
document.getElementById("app").style.display = "block";
});
// listen for Esc key and close the notification
window.addEventListener("keydown", (event) => {
if (this.notifications.showPopup && event.key === "Escape") {
this.notifications.showPopup = false;
}
});
},
methods: {
setupWebSocket() {
Expand Down

0 comments on commit 8f87dd4

Please sign in to comment.