Merge pull request #1479 from tamaina/master

タイムラインで古い投稿から順に画面から消していく
This commit is contained in:
syuilo
2018-04-17 04:47:46 +09:00
committed by GitHub
2 changed files with 22 additions and 5 deletions

View File

@@ -5,11 +5,11 @@
<mk-ellipsis-icon/>
</div>
<p class="empty" v-if="notes.length == 0 && !fetching">
%fa:R comments%自分の投稿や自分がフォローしているユーザーの投稿が表示されます
%fa:R comments%%i18n:@empty%
</p>
<mk-notes :notes="notes" ref="timeline">
<button slot="footer" @click="more" :disabled="moreFetching" :style="{ cursor: moreFetching ? 'wait' : 'pointer' }">
<template v-if="!moreFetching">もっと見る</template>
<template v-if="!moreFetching">%i18n:@load-more%</template>
<template v-if="moreFetching">%fa:spinner .pulse .fw%</template>
</button>
</mk-notes>
@@ -29,7 +29,8 @@ export default Vue.extend({
notes: [],
connection: null,
connectionId: null,
date: null
date: null,
isTop: true
};
},
computed: {
@@ -101,6 +102,7 @@ export default Vue.extend({
sound.play();
}
if (this.isTop) this.notes.pop();
this.notes.unshift(note);
},
onChangeFollowing() {
@@ -111,6 +113,7 @@ export default Vue.extend({
const current = window.scrollY + window.innerHeight;
if (current > document.body.offsetHeight - 8) this.more();
}
this.isTop = window.scrollY < 100;
},
onKeydown(e) {
if (e.target.tagName != 'INPUT' && e.target.tagName != 'TEXTAREA') {