From dc8c05373c7ffc413196c6b9fd8f29dbae0cbfaa 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 98e28f4ddfb41a099a613d35b5dd787ad5e6c274 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 aea194fba23419568c88e7eea98d83be020483fc 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 7df6419208f43c94ea5e493ba3066e21cc01b0a3 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 83327fc477eab857e89079a247985a1a9cf5acfc 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 50baad1fd0e21b90a5392df671f2a997bc8ce6ca 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 80a0a9f052b8a792481eb41d12184f8982234fa7 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 8bfa215208f593e30964604fed6d80d852cae3b5 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 9a152162e53bc8d047ed4b85859b7b1806492011 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 b4410744836e3573f49c5f45e0ee97b12c44556f 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?) {