1
0
mirror of https://git.pleroma.social/sjw/pleroma-fe.git synced 2024-11-11 21:39:34 +01:00

Merge branch 'wakarimasen/pleroma-fe-highlight-notice' into 'develop'

Wakarimasen/pleroma fe highlight notice

See merge request !41
This commit is contained in:
lambadalambda 2017-03-05 14:59:33 -05:00
commit 67c22276d3
6 changed files with 21 additions and 6 deletions

View File

@ -47,6 +47,9 @@ const conversation = {
.then((status) => this.$store.dispatch('addNewStatuses', { statuses: [status] }))
.then(() => this.fetchConversation())
}
},
focused: function (id) {
return (id === this.statusoid.id)
}
}
}

View File

@ -8,7 +8,7 @@
</div>
<div class="panel-body">
<div class="timeline">
<status v-for="status in conversation" :key="status.id" v-bind:statusoid="status":expandable='false'></status>
<status v-for="status in conversation" :key="status.id" v-bind:statusoid="status":expandable='false':focused="focused(status.id)"></status>
</div>
</div>
</div>

View File

@ -8,7 +8,8 @@ import UserCardContent from '../user_card_content/user_card_content.vue'
const Status = {
props: [
'statusoid',
'expandable'
'expandable',
'focused'
],
data: () => ({
replying: false,
@ -30,7 +31,8 @@ const Status = {
loggedIn () {
return !!this.$store.state.users.currentUser
},
muted () { return !this.unmuted && this.status.user.muted }
muted () { return !this.unmuted && this.status.user.muted },
isReply () { return !!this.statusoid.in_reply_to_status_id }
},
components: {
Attachment,

View File

@ -1,5 +1,5 @@
<template>
<div class="status-el base00-background" v-if="!status.deleted" v-bind:class="{ 'expanded-status': !expandable }">
<div class="status-el base00-background" v-if="!status.deleted" v-bind:class="[{ 'expanded-status': !expandable }, { 'base01-background': focused }]">
<template v-if="muted">
<div class="media status container muted">
<small><router-link :to="{ name: 'user-profile', params: { id: status.user.id } }">{{status.user.screen_name}}</router-link></small>
@ -34,6 +34,13 @@
{{status.in_reply_to_screen_name}}
</router-link>
</small>
<template v-if="isReply">
<small>
<router-link :to="{ name: 'conversation', params: { id: status.in_reply_to_status_id } }">
<i class="icon-reply"></i>
</router-link>
</small>
</template>
-
<small>
<router-link :to="{ name: 'conversation', params: { id: status.id } }">

View File

@ -1,7 +1,7 @@
<template>
<div>
<conversation v-if="expanded" @toggleExpanded="toggleExpanded" :collapsable="true" :statusoid="statusoid"></conversation>
<status v-if="!expanded" @toggleExpanded="toggleExpanded" :expandable="true" :statusoid="statusoid"></status>
<status v-if="!expanded" @toggleExpanded="toggleExpanded" :expandable="true" :statusoid="statusoid" :focused="false"></status>
</div>
</template>

View File

@ -53,7 +53,7 @@ const routes = [
{ path: '/main/all', component: PublicAndExternalTimeline },
{ path: '/main/public', component: PublicTimeline },
{ path: '/main/friends', component: FriendsTimeline },
{ name: 'conversation', path: '/notice/:id', component: ConversationPage },
{ name: 'conversation', path: '/notice/:id', component: ConversationPage, meta: { dontScroll: true } },
{ name: 'user-profile', path: '/users/:id', component: UserProfile },
{ name: 'mentions', path: '/:username/mentions', component: Mentions },
{ name: 'settings', path: '/settings', component: Settings }
@ -63,6 +63,9 @@ const router = new VueRouter({
mode: 'history',
routes,
scrollBehavior: (to, from, savedPosition) => {
if (to.matched.some(m => m.meta.dontScroll)) {
return false
}
return savedPosition || { x: 0, y: 0 }
}
})