This commit is contained in:
syuilo 2018-04-16 15:13:31 +09:00
parent 52b74c35f2
commit 8ff8f14d4e
3 changed files with 16 additions and 15 deletions

View file

@ -13,9 +13,7 @@
<p class="location" v-if="user.host === null && user.profile.location">%fa:map-marker%{{ user.profile.location }}</p>
</div>
<footer>
<router-link :to="user | userPage" :data-active="$parent.page == 'home'">%fa:home%概要</router-link>
<router-link :to="user | userPage('media')" :data-active="$parent.page == 'media'">%fa:image%メディア</router-link>
<router-link :to="user | userPage('graphs')" :data-active="$parent.page == 'graphs'">%fa:chart-bar%グラフ</router-link>
<router-link :to="user | userPage" :data-active="$parent.page == 'home'">%fa:home%ホーム</router-link>
</footer>
</div>
</div>

View file

@ -3,6 +3,7 @@
<header>
<span :data-is-active="mode == 'default'" @click="mode = 'default'">投稿</span>
<span :data-is-active="mode == 'with-replies'" @click="mode = 'with-replies'">投稿と返信</span>
<span :data-is-active="mode == 'with-media'" @click="mode = 'with-media'">メディア</span>
</header>
<div class="loading" v-if="fetching">
<mk-ellipsis-icon/>
@ -31,16 +32,16 @@ export default Vue.extend({
date: null
};
},
watch: {
mode() {
this.fetch();
}
},
computed: {
empty(): boolean {
return this.notes.length == 0;
}
},
watch: {
mode() {
this.fetch();
}
},
mounted() {
document.addEventListener('keydown', this.onDocumentKeydown);
window.addEventListener('scroll', this.onScroll);
@ -63,7 +64,8 @@ export default Vue.extend({
(this as any).api('users/notes', {
userId: this.user.id,
untilDate: this.date ? this.date.getTime() : undefined,
with_replies: this.mode == 'with-replies'
includeReplies: this.mode == 'with-replies',
withMedia: this.mode == 'with-media'
}).then(notes => {
this.notes = notes;
this.fetching = false;
@ -75,7 +77,8 @@ export default Vue.extend({
this.moreFetching = true;
(this as any).api('users/notes', {
userId: this.user.id,
with_replies: this.mode == 'with-replies',
includeReplies: this.mode == 'with-replies',
withMedia: this.mode == 'with-media',
untilId: this.notes[this.notes.length - 1].id
}).then(notes => {
this.moreFetching = false;

View file

@ -51,8 +51,8 @@
</nav>
<div class="body">
<x-home v-if="page == 'home'" :user="user"/>
<mk-user-timeline v-if="page == 'notes'" :user="user"/>
<mk-user-timeline v-if="page == 'media'" :user="user" with-media/>
<mk-user-timeline v-if="page == 'notes'" :user="user" key="tl"/>
<mk-user-timeline v-if="page == 'media'" :user="user" :with-media="true" key="media"/>
</div>
</main>
</mk-ui>