From 25c12309f2b3adb25fee543ddd64d2e8cc6ea93c Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Sun, 1 Nov 2020 14:41:40 +0700 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=BA?= =?UTF-8?q?=D0=B8=20=D0=BF=D0=BE=D0=B2=D0=B5=D0=B4=D0=B5=D0=BD=D0=B8=D1=8F?= =?UTF-8?q?=20=D0=B4=D0=B8=D0=B0=D0=BB=D0=BE=D0=B3=D0=B0=20=D0=BD=D0=B0=20?= =?UTF-8?q?"Enter"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/ExternalLibs/ExternalLibs.vue | 46 ++++++++++++++----- 1 file changed, 35 insertions(+), 11 deletions(-) diff --git a/client/components/ExternalLibs/ExternalLibs.vue b/client/components/ExternalLibs/ExternalLibs.vue index ac22e895..2b587acc 100644 --- a/client/components/ExternalLibs/ExternalLibs.vue +++ b/client/components/ExternalLibs/ExternalLibs.vue @@ -40,7 +40,9 @@ Закладки - +
- +
- +
@@ -432,7 +434,7 @@ class ExternalLibs extends Vue { return url; } - onInputFocus(event) { + selectAllOnFocus(event) { if (event.target.select) event.target.select(); } @@ -483,7 +485,24 @@ class ExternalLibs extends Vue { this.updateBookmarkLink(); } + bookmarkLinkKeyDown(event) { + if (event.key == 'Enter') { + this.$refs.bookmarkDesc.focus(); + event.preventDefault(); + } + } + + bookmarkDescKeyDown(event) { + if (event.key == 'Enter') { + this.okAddBookmark(); + event.preventDefault(); + } + } + async okAddBookmark() { + if (!this.bookmarkLink) + return; + const link = this.addProtocol(this.bookmarkLink); let index = -1; try { @@ -558,16 +577,21 @@ class ExternalLibs extends Vue { this.sendMessage({type: 'close'}); } + bookUrlKeyDown(event) { + if (event.key == 'Enter') { + this.submitUrl(); + event.preventDefault(); + } + } + keyHook() { if (this.$root.rootRoute() == '/external-libs') { if (this.$refs.dialogAddBookmark.active) return false; - //недостатки сторонних ui - const input = this.$refs.input.$refs.input; - if (document.activeElement === input && event.type == 'keydown' && event.key == 'Enter') { - this.submitUrl(); - return true; + if (event.type == 'keydown' && event.key == 'F4') { + this.addBookmark() + return; } if (event.type == 'keydown' && event.key == 'Escape' &&