From 1136457fb811b0fd192df9474f2919228a714305 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 13 Feb 2018 12:21:02 +0900 Subject: [PATCH] wip --- .../app/common/views/components/messaging.vue | 49 +++++++++++-------- 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/src/web/app/common/views/components/messaging.vue b/src/web/app/common/views/components/messaging.vue index 2e81325cb..386e705b0 100644 --- a/src/web/app/common/views/components/messaging.vue +++ b/src/web/app/common/views/components/messaging.vue @@ -6,38 +6,45 @@
-
    -
  1. +
  2. - - { user.name } - @{ user.username } + + {{ user.name }} + @{{ user.username }}
-
- @@ -123,26 +130,29 @@ export default Vue.extend({ } }, onSearchResultKeydown(i, e) { + const list = this.$refs.searchResult as any; + const cancel = () => { e.preventDefault(); e.stopPropagation(); }; + switch (true) { case e.which == 27: // [ESC] cancel(); - this.$refs.search.focus(); + (this.$refs.search as any).focus(); break; case e.which == 9 && e.shiftKey: // [TAB] + [Shift] case e.which == 38: // [↑] cancel(); - (this.$refs.searchResult.childNodes[i].previousElementSibling || this.$refs.searchResult.childNodes[this.searchResult.length - 1]).focus(); + (list.childNodes[i].previousElementSibling || list.childNodes[this.result.length - 1]).focus(); break; case e.which == 9: // [TAB] case e.which == 40: // [↓] cancel(); - (this.$refs.searchResult.childNodes[i].nextElementSibling || this.$refs.searchResult.childNodes[0]).focus(); + (list.childNodes[i].nextElementSibling || list.childNodes[0]).focus(); break; } } @@ -150,7 +160,6 @@ export default Vue.extend({ }); -