From 1fccde38f6218334770cd2338d85c51865ee9798 Mon Sep 17 00:00:00 2001 From: syuilo <syuilotan@yahoo.co.jp> Date: Sat, 20 Oct 2018 02:49:39 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=87=E3=83=83=E3=82=AD=E3=81=AE=E3=82=AD?= =?UTF-8?q?=E3=83=BC=E3=83=9C=E3=83=BC=E3=83=89=E3=82=B7=E3=83=A7=E3=83=BC?= =?UTF-8?q?=E3=83=88=E3=82=AB=E3=83=83=E3=83=88=E3=82=92=E5=BC=B7=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/pages/deck/deck.direct-column.vue | 12 +++++++++++- .../app/desktop/views/pages/deck/deck.direct.vue | 14 ++++++++++++-- .../desktop/views/pages/deck/deck.hashtag-tl.vue | 14 ++++++++++++-- .../desktop/views/pages/deck/deck.list-tl.vue | 16 ++++++++++++++-- .../views/pages/deck/deck.mentions-column.vue | 12 +++++++++++- .../desktop/views/pages/deck/deck.mentions.vue | 14 ++++++++++++-- 6 files changed, 72 insertions(+), 10 deletions(-) diff --git a/src/client/app/desktop/views/pages/deck/deck.direct-column.vue b/src/client/app/desktop/views/pages/deck/deck.direct-column.vue index d5093761f4..def1111694 100644 --- a/src/client/app/desktop/views/pages/deck/deck.direct-column.vue +++ b/src/client/app/desktop/views/pages/deck/deck.direct-column.vue @@ -2,7 +2,7 @@ <x-column :name="name" :column="column" :is-stacked="isStacked"> <span slot="header">%fa:envelope R%{{ name }}</span> - <x-direct/> + <x-direct @parentFocus="parentFocus"/> </x-column> </template> @@ -34,5 +34,15 @@ export default Vue.extend({ return '%i18n:common.deck.direct%'; } }, + + methods: { + focus() { + this.$refs.tl.focus(); + }, + + parentFocus(direction) { + this.$emit('parentFocus', direction); + }, + } }); </script> diff --git a/src/client/app/desktop/views/pages/deck/deck.direct.vue b/src/client/app/desktop/views/pages/deck/deck.direct.vue index c771e58a6e..877c156045 100644 --- a/src/client/app/desktop/views/pages/deck/deck.direct.vue +++ b/src/client/app/desktop/views/pages/deck/deck.direct.vue @@ -1,5 +1,5 @@ <template> - <x-notes ref="timeline" :more="existMore ? more : null"/> + <x-notes ref="timeline" :more="existMore ? more : null" @parentFocus="parentFocus"/> </template> <script lang="ts"> @@ -58,6 +58,7 @@ export default Vue.extend({ }, rej); })); }, + more() { this.moreFetching = true; @@ -82,12 +83,21 @@ export default Vue.extend({ return promise; }, + onNote(note) { // Prepend a note if (note.visibility == 'specified') { (this.$refs.timeline as any).prepend(note); } - } + }, + + focus() { + this.$refs.timeline.focus(); + }, + + parentFocus(direction) { + this.$emit('parentFocus', direction); + }, } }); </script> diff --git a/src/client/app/desktop/views/pages/deck/deck.hashtag-tl.vue b/src/client/app/desktop/views/pages/deck/deck.hashtag-tl.vue index 02d99d3883..98c15b4fba 100644 --- a/src/client/app/desktop/views/pages/deck/deck.hashtag-tl.vue +++ b/src/client/app/desktop/views/pages/deck/deck.hashtag-tl.vue @@ -1,5 +1,5 @@ <template> - <x-notes ref="timeline" :more="existMore ? more : null" :media-view="mediaView"/> +<x-notes ref="timeline" :more="existMore ? more : null" :media-view="mediaView" @parentFocus="parentFocus"/> </template> <script lang="ts"> @@ -80,6 +80,7 @@ export default Vue.extend({ }, rej); })); }, + more() { this.moreFetching = true; @@ -105,12 +106,21 @@ export default Vue.extend({ return promise; }, + onNote(note) { if (this.mediaOnly && note.files.length == 0) return; // Prepend a note (this.$refs.timeline as any).prepend(note); - } + }, + + focus() { + this.$refs.timeline.focus(); + }, + + parentFocus(direction) { + this.$emit('parentFocus', direction); + }, } }); </script> diff --git a/src/client/app/desktop/views/pages/deck/deck.list-tl.vue b/src/client/app/desktop/views/pages/deck/deck.list-tl.vue index a8d811dda2..cd27743f92 100644 --- a/src/client/app/desktop/views/pages/deck/deck.list-tl.vue +++ b/src/client/app/desktop/views/pages/deck/deck.list-tl.vue @@ -1,5 +1,5 @@ <template> -<x-notes ref="timeline" :more="existMore ? more : null" :media-view="mediaView"/> +<x-notes ref="timeline" :more="existMore ? more : null" :media-view="mediaView" @parentFocus="parentFocus"/> </template> <script lang="ts"> @@ -84,6 +84,7 @@ export default Vue.extend({ }, rej); })); }, + more() { this.moreFetching = true; @@ -109,18 +110,29 @@ export default Vue.extend({ return promise; }, + onNote(note) { if (this.mediaOnly && note.files.length == 0) return; // Prepend a note (this.$refs.timeline as any).prepend(note); }, + onUserAdded() { this.fetch(); }, + onUserRemoved() { this.fetch(); - } + }, + + focus() { + this.$refs.timeline.focus(); + }, + + parentFocus(direction) { + this.$emit('parentFocus', direction); + }, } }); </script> diff --git a/src/client/app/desktop/views/pages/deck/deck.mentions-column.vue b/src/client/app/desktop/views/pages/deck/deck.mentions-column.vue index 8ec10164f2..ef0e4ad787 100644 --- a/src/client/app/desktop/views/pages/deck/deck.mentions-column.vue +++ b/src/client/app/desktop/views/pages/deck/deck.mentions-column.vue @@ -2,7 +2,7 @@ <x-column :name="name" :column="column" :is-stacked="isStacked"> <span slot="header">%fa:at%{{ name }}</span> - <x-mentions/> + <x-mentions ref="tl" @parentFocus="parentFocus"/> </x-column> </template> @@ -34,5 +34,15 @@ export default Vue.extend({ return '%i18n:common.deck.mentions%'; } }, + + methods: { + focus() { + this.$refs.tl.focus(); + }, + + parentFocus(direction) { + this.$emit('parentFocus', direction); + }, + } }); </script> diff --git a/src/client/app/desktop/views/pages/deck/deck.mentions.vue b/src/client/app/desktop/views/pages/deck/deck.mentions.vue index 17b572f146..29bf7d95c4 100644 --- a/src/client/app/desktop/views/pages/deck/deck.mentions.vue +++ b/src/client/app/desktop/views/pages/deck/deck.mentions.vue @@ -1,5 +1,5 @@ <template> - <x-notes ref="timeline" :more="existMore ? more : null"/> + <x-notes ref="timeline" :more="existMore ? more : null" @parentFocus="parentFocus"/> </template> <script lang="ts"> @@ -57,6 +57,7 @@ export default Vue.extend({ }, rej); })); }, + more() { this.moreFetching = true; @@ -80,10 +81,19 @@ export default Vue.extend({ return promise; }, + onNote(note) { // Prepend a note (this.$refs.timeline as any).prepend(note); - } + }, + + focus() { + this.$refs.timeline.focus(); + }, + + parentFocus(direction) { + this.$emit('parentFocus', direction); + }, } }); </script>