From ea9613f2cfa17f325cb549b5f11b33bd48ec3e9d Mon Sep 17 00:00:00 2001 From: schlagmichdoch Date: Wed, 25 Jan 2023 10:01:45 +0100 Subject: [PATCH] add btn shortcut as title tooltip --- public/index.html | 14 +++++++------- public/scripts/ui.js | 13 ++++++++----- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/public/index.html b/public/index.html index 290fd01..8595d3c 100644 --- a/public/index.html +++ b/public/index.html @@ -168,9 +168,9 @@
- +
- +
@@ -183,9 +183,9 @@

Send a Message

- +
- Cancel + Cancel
@@ -198,14 +198,14 @@

Message Received

- +
- +
- + diff --git a/public/scripts/ui.js b/public/scripts/ui.js index 94e8c98..e6172fe 100644 --- a/public/scripts/ui.js +++ b/public/scripts/ui.js @@ -964,8 +964,7 @@ class SendTextDialog extends Dialog { if (this.$el.attributes["show"]) { if (e.code === "Escape") { this.hide(); - } - if (e.code === "Enter" && (e.ctrlKey || e.metaKey)) { + } else if (e.code === "Enter" && (e.ctrlKey || e.metaKey)) { this._send(); this.hide(); } @@ -1005,9 +1004,13 @@ class ReceiveTextDialog extends Dialog { } async _onKeyDown(e) { - if (this.$el.attributes["show"] && e.code === "KeyC" && (e.ctrlKey || e.metaKey)) { - await this._onCopy() - this.hide(); + if (this.$el.attributes["show"]) { + if (e.code === "KeyC" && (e.ctrlKey || e.metaKey)) { + await this._onCopy() + this.hide(); + } else if (e.code === "Escape") { + this.hide(); + } } }