From dc8c05373c7ffc413196c6b9fd8f29dbae0cbfaa Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 15 Apr 2018 19:10:12 +0900 Subject: [PATCH 1/6] 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 aea194fba23419568c88e7eea98d83be020483fc Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 15 Apr 2018 19:30:51 +0900 Subject: [PATCH 2/6] 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 3/6] 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 4/6] 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 5/6] 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 6/6] 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: {