From 87c364b8eebb4ec198bbe78f2bf97ebc2f883d7a Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Sun, 1 Nov 2020 13:38:05 +0700 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BF=D0=BE=D0=B2=D0=B5=D0=B4=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F=20=D0=BA=D0=BE=D0=BC=D0=BF=D0=BE=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D1=82=D0=B0=20select?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/ExternalLibs/ExternalLibs.vue | 46 +++++++++++++++++-- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/client/components/ExternalLibs/ExternalLibs.vue b/client/components/ExternalLibs/ExternalLibs.vue index 4447ae3d..7b01b44a 100644 --- a/client/components/ExternalLibs/ExternalLibs.vue +++ b/client/components/ExternalLibs/ExternalLibs.vue @@ -13,7 +13,7 @@
- {{ removeProtocol(rootLink) }}
- Закладки + + Открыть Открыть в читалке @@ -67,7 +70,7 @@ placeholder="Ссылка для закладки" maxlength="2000" @focus="onInputFocus"> - @@ -154,6 +157,29 @@ class ExternalLibs extends Vue { } mounted() { + //Поправка метода toggleOption компонента select фреймворка quasar, необходимо другое поведение + //$emit('input'.. вызывается всегда + this.toggleOption = function(opt, keepOpen) { + if (this.editable !== true || opt === void 0 || this.isOptionDisabled(opt) === true) { + return; + } + + const optValue = this.getOptionValue(opt); + + if (this.multiple !== true) { + if (keepOpen !== true) { + this.updateInputValue(this.fillInput === true ? this.getOptionLabel(opt) : '', true, true); + this.hidePopup(); + } + + this.$refs.target !== void 0 && this.$refs.target.focus(); + this.$emit('input', this.emitValue === true ? optValue : opt); + } + }; + + this.$refs.rootLink.toggleOption = this.toggleOption; + this.$refs.selectedLink.toggleOption = this.toggleOption; + (async() => { //подождем this.mode let i = 0; @@ -405,6 +431,15 @@ class ExternalLibs extends Vue { event.target.select(); } + rootLinkInput() { + this.updateSelectedLink(); + this.updateStartLink(); + } + + selectedLinkInput() { + this.updateStartLink(); + } + submitUrl() { if (this.bookUrl) { this.sendMessage({type: 'submitUrl', data: { @@ -423,6 +458,7 @@ class ExternalLibs extends Vue { this.addBookmarkVisible = true; this.$nextTick(() => { this.$refs.bookmarkLink.focus(); + this.$refs.defaultRootLink.toggleOption = this.toggleOption; }); } @@ -437,6 +473,10 @@ class ExternalLibs extends Vue { } } + defaultRootLinkInput() { + this.updateBookmarkLink(); + } + async okAddBookmark() { const link = this.addProtocol(this.bookmarkLink); let index = -1;