From 049171e97864050b5d07a8a04f21f8073af81237 Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 15 Apr 2018 19:10:12 +0900 Subject: [PATCH 01/10] Update timeline.vue --- src/client/app/mobile/views/components/timeline.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/client/app/mobile/views/components/timeline.vue b/src/client/app/mobile/views/components/timeline.vue index 12cc7fcf1..132b5216e 100644 --- a/src/client/app/mobile/views/components/timeline.vue +++ b/src/client/app/mobile/views/components/timeline.vue @@ -95,6 +95,7 @@ export default Vue.extend({ }); }, onNote(note) { + this.notes.pop(); this.notes.unshift(note); }, onChangeFollowing() { From cf97784de1cca8792c205fabde83286544407c43 Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 15 Apr 2018 19:29:40 +0900 Subject: [PATCH 02/10] Update timeline.vue --- src/client/app/desktop/views/components/timeline.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/client/app/desktop/views/components/timeline.vue b/src/client/app/desktop/views/components/timeline.vue index f148e840a..cdedbac19 100644 --- a/src/client/app/desktop/views/components/timeline.vue +++ b/src/client/app/desktop/views/components/timeline.vue @@ -101,6 +101,7 @@ export default Vue.extend({ sound.play(); } + this.notes.pop(); this.notes.unshift(note); }, onChangeFollowing() { From de7542b939a50753d3cac891ee5d09f82bf8ff24 Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 15 Apr 2018 19:30:51 +0900 Subject: [PATCH 03/10] Update timeline.vue --- src/client/app/desktop/views/components/timeline.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/client/app/desktop/views/components/timeline.vue b/src/client/app/desktop/views/components/timeline.vue index f148e840a..cdedbac19 100644 --- a/src/client/app/desktop/views/components/timeline.vue +++ b/src/client/app/desktop/views/components/timeline.vue @@ -101,6 +101,7 @@ export default Vue.extend({ sound.play(); } + this.notes.pop(); this.notes.unshift(note); }, onChangeFollowing() { From 78479d3f17cf5147de04acb1c71360be07429060 Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 15 Apr 2018 20:50:53 +0900 Subject: [PATCH 04/10] Update timeline.vue --- src/client/app/desktop/views/components/timeline.vue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/client/app/desktop/views/components/timeline.vue b/src/client/app/desktop/views/components/timeline.vue index cdedbac19..266abd64a 100644 --- a/src/client/app/desktop/views/components/timeline.vue +++ b/src/client/app/desktop/views/components/timeline.vue @@ -5,11 +5,11 @@

- %fa:R comments%自分の投稿や、自分がフォローしているユーザーの投稿が表示されます。 + %fa:R comments%%i18n:@empty%

@@ -29,7 +29,8 @@ export default Vue.extend({ notes: [], connection: null, connectionId: null, - date: null + date: null, + isTop: true }; }, computed: { @@ -101,7 +102,7 @@ export default Vue.extend({ sound.play(); } - this.notes.pop(); + if(isTop) this.notes.pop(); this.notes.unshift(note); }, onChangeFollowing() { @@ -112,6 +113,8 @@ export default Vue.extend({ const current = window.scrollY + window.innerHeight; if (current > document.body.offsetHeight - 8) this.more(); } + if (window.scrollY > 100) this.isTop = false; + else this.isTop = true; }, onKeydown(e) { if (e.target.tagName != 'INPUT' && e.target.tagName != 'TEXTAREA') { From 4358d61d64caba097016afe2b356ec2e8181b1cd Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 15 Apr 2018 20:57:30 +0900 Subject: [PATCH 05/10] Update timeline.vue --- src/client/app/desktop/views/components/timeline.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/app/desktop/views/components/timeline.vue b/src/client/app/desktop/views/components/timeline.vue index 266abd64a..829e73106 100644 --- a/src/client/app/desktop/views/components/timeline.vue +++ b/src/client/app/desktop/views/components/timeline.vue @@ -102,7 +102,7 @@ export default Vue.extend({ sound.play(); } - if(isTop) this.notes.pop(); + if (this.isTop) this.notes.pop(); this.notes.unshift(note); }, onChangeFollowing() { From 304c3ef1d7f41303d0e47cdee60ce41da694913a Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 15 Apr 2018 20:57:37 +0900 Subject: [PATCH 06/10] Update timeline.vue --- .../app/mobile/views/components/timeline.vue | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/client/app/mobile/views/components/timeline.vue b/src/client/app/mobile/views/components/timeline.vue index 132b5216e..15a7b5344 100644 --- a/src/client/app/mobile/views/components/timeline.vue +++ b/src/client/app/mobile/views/components/timeline.vue @@ -37,7 +37,8 @@ export default Vue.extend({ notes: [], existMore: false, connection: null, - connectionId: null + connectionId: null, + isTop: true; }; }, computed: { @@ -53,6 +54,8 @@ export default Vue.extend({ this.connection.on('follow', this.onChangeFollowing); this.connection.on('unfollow', this.onChangeFollowing); + window.addEventListener('scroll', this.onScroll); + this.fetch(); }, beforeDestroy() { @@ -95,11 +98,19 @@ export default Vue.extend({ }); }, onNote(note) { - this.notes.pop(); + if (this.isTop) this.notes.pop(); this.notes.unshift(note); }, onChangeFollowing() { this.fetch(); + }, + onScroll() { + if ((this as any).os.i.clientSettings.fetchOnScroll !== false) { + const current = window.scrollY + window.innerHeight; + if (current > document.body.offsetHeight - 8) this.more(); + } + if (window.scrollY > 100) this.isTop = false; + else this.isTop = true; } } }); From d4ce00cb242bdd9c3f49185635b5826f5e4148c2 Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 15 Apr 2018 21:00:28 +0900 Subject: [PATCH 07/10] oops --- src/client/app/mobile/views/components/timeline.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/app/mobile/views/components/timeline.vue b/src/client/app/mobile/views/components/timeline.vue index 15a7b5344..7bb71cb07 100644 --- a/src/client/app/mobile/views/components/timeline.vue +++ b/src/client/app/mobile/views/components/timeline.vue @@ -38,7 +38,7 @@ export default Vue.extend({ existMore: false, connection: null, connectionId: null, - isTop: true; + isTop: true }; }, computed: { From c9b26183f321da59d0242e1979dda37c4feac3a8 Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 15 Apr 2018 23:49:14 +0900 Subject: [PATCH 08/10] Update timeline.vue --- src/client/app/desktop/views/components/timeline.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/client/app/desktop/views/components/timeline.vue b/src/client/app/desktop/views/components/timeline.vue index 829e73106..dfe3e5437 100644 --- a/src/client/app/desktop/views/components/timeline.vue +++ b/src/client/app/desktop/views/components/timeline.vue @@ -113,8 +113,7 @@ export default Vue.extend({ const current = window.scrollY + window.innerHeight; if (current > document.body.offsetHeight - 8) this.more(); } - if (window.scrollY > 100) this.isTop = false; - else this.isTop = true; + this.isTop = window.scrollY < 100; }, onKeydown(e) { if (e.target.tagName != 'INPUT' && e.target.tagName != 'TEXTAREA') { From 5d90abc011222a837b2771cac1b6dc6dc17aeade Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 15 Apr 2018 23:50:00 +0900 Subject: [PATCH 09/10] Update timeline.vue --- src/client/app/mobile/views/components/timeline.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/client/app/mobile/views/components/timeline.vue b/src/client/app/mobile/views/components/timeline.vue index 7bb71cb07..17d5d18ff 100644 --- a/src/client/app/mobile/views/components/timeline.vue +++ b/src/client/app/mobile/views/components/timeline.vue @@ -98,8 +98,7 @@ export default Vue.extend({ }); }, onNote(note) { - if (this.isTop) this.notes.pop(); - this.notes.unshift(note); + this.isTop = window.scrollY < 100; }, onChangeFollowing() { this.fetch(); From f97c76153877bce83c7cf2e9ec8e178bae0f00fb Mon Sep 17 00:00:00 2001 From: tamaina Date: Mon, 16 Apr 2018 20:44:55 +0900 Subject: [PATCH 10/10] oops --- src/client/app/mobile/views/components/timeline.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/client/app/mobile/views/components/timeline.vue b/src/client/app/mobile/views/components/timeline.vue index 17d5d18ff..546270db9 100644 --- a/src/client/app/mobile/views/components/timeline.vue +++ b/src/client/app/mobile/views/components/timeline.vue @@ -62,7 +62,10 @@ export default Vue.extend({ this.connection.off('note', this.onNote); this.connection.off('follow', this.onChangeFollowing); this.connection.off('unfollow', this.onChangeFollowing); + this.connection.off('unfollow', this.onChangeFollowing); (this as any).os.stream.dispose(this.connectionId); + + window.removeEventListener('scroll', this.onScroll); }, methods: { fetch(cb?) {