From b7c5c71c6fdd139406166cff697a4e94bb11384a Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 16 Dec 2018 08:45:10 +0900 Subject: [PATCH] [Client] Resolve #2951 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit あと検索フォームでサジェストを有効に --- .../views/components/messaging-room.form.vue | 2 +- .../app/common/views/directives/autocomplete.ts | 12 +++++++----- .../app/desktop/views/components/post-form.vue | 4 ++-- .../desktop/views/components/ui.header.search.vue | 15 +++++++++------ .../app/desktop/views/widgets/post-form.vue | 2 +- .../app/mobile/views/components/post-form.vue | 4 ++-- src/client/app/mobile/views/components/ui.nav.vue | 10 +++++++++- 7 files changed, 31 insertions(+), 18 deletions(-) diff --git a/src/client/app/common/views/components/messaging-room.form.vue b/src/client/app/common/views/components/messaging-room.form.vue index 97e2e16e4..729ed640b 100644 --- a/src/client/app/common/views/components/messaging-room.form.vue +++ b/src/client/app/common/views/components/messaging-room.form.vue @@ -9,7 +9,7 @@ @keypress="onKeypress" @paste="onPaste" :placeholder="$t('input-message-here')" - v-autocomplete="'text'" + v-autocomplete="{ model: 'text' }" >
{{ file.name }}
diff --git a/src/client/app/common/views/directives/autocomplete.ts b/src/client/app/common/views/directives/autocomplete.ts index 4440747e1..355e3bd52 100644 --- a/src/client/app/common/views/directives/autocomplete.ts +++ b/src/client/app/common/views/directives/autocomplete.ts @@ -21,21 +21,23 @@ class Autocomplete { private suggestion: any; private textarea: any; private vm: any; - private model: any; private currentType: string; + private opts: { + model: string; + }; private get text(): string { - return this.vm[this.model]; + return this.vm[this.opts.model]; } private set text(text: string) { - this.vm[this.model] = text; + this.vm[this.opts.model] = text; } /** * 対象のテキストエリアを与えてインスタンスを初期化します。 */ - constructor(textarea, vm, model) { + constructor(textarea, vm, opts) { //#region BIND this.onInput = this.onInput.bind(this); this.complete = this.complete.bind(this); @@ -45,7 +47,7 @@ class Autocomplete { this.suggestion = null; this.textarea = textarea; this.vm = vm; - this.model = model; + this.opts = opts; } /** diff --git a/src/client/app/desktop/views/components/post-form.vue b/src/client/app/desktop/views/components/post-form.vue index c2f6a94f7..0e86bbf9f 100644 --- a/src/client/app/desktop/views/components/post-form.vue +++ b/src/client/app/desktop/views/components/post-form.vue @@ -17,12 +17,12 @@ #{{ tag }}
{{ $t('local-only-message') }}
- +