added activatePanel onclick for timeago button

This commit is contained in:
ValD 2018-12-11 01:42:51 +05:30
parent a8acba8cb2
commit 1623dcb417
7 changed files with 10 additions and 7 deletions

View file

@ -30,7 +30,7 @@
<instance-specific-panel v-if="showInstanceSpecificPanel"></instance-specific-panel> <instance-specific-panel v-if="showInstanceSpecificPanel"></instance-specific-panel>
<features-panel v-if="!currentUser"></features-panel> <features-panel v-if="!currentUser"></features-panel>
<who-to-follow-panel v-if="currentUser && suggestionsEnabled"></who-to-follow-panel> <who-to-follow-panel v-if="currentUser && suggestionsEnabled"></who-to-follow-panel>
<notifications v-if="currentUser"></notifications> <notifications :activatePanel="activatePanel" v-if="currentUser"></notifications>
</div> </div>
</div> </div>
</div> </div>

View file

@ -11,7 +11,8 @@ const Notification = {
} }
}, },
props: [ props: [
'notification' 'notification',
'activatePanel'
], ],
components: { components: {
Status, StillImage, UserCardContent Status, StillImage, UserCardContent

View file

@ -1,5 +1,5 @@
<template> <template>
<status v-if="notification.type === 'mention'" :compact="true" :statusoid="notification.status"></status> <status :activatePanel="activatePanel" v-if="notification.type === 'mention'" :compact="true" :statusoid="notification.status"></status>
<div class="non-mention" :class="[userClass, { highlighted: userStyle }]" :style="[ userStyle ]"v-else> <div class="non-mention" :class="[userClass, { highlighted: userStyle }]" :style="[ userStyle ]"v-else>
<a class='avatar-container' :href="notification.action.user.statusnet_profile_url" @click.stop.prevent.capture="toggleUserExpanded"> <a class='avatar-container' :href="notification.action.user.statusnet_profile_url" @click.stop.prevent.capture="toggleUserExpanded">
<StillImage class='avatar-compact' :class="{'better-shadow': betterShadow}" :src="notification.action.user.profile_image_url_original"/> <StillImage class='avatar-compact' :class="{'better-shadow': betterShadow}" :src="notification.action.user.profile_image_url_original"/>
@ -31,7 +31,7 @@
<router-link :to="{ name: 'user-profile', params: { id: notification.action.user.id } }">@{{notification.action.user.screen_name}}</router-link> <router-link :to="{ name: 'user-profile', params: { id: notification.action.user.id } }">@{{notification.action.user.screen_name}}</router-link>
</div> </div>
<template v-else> <template v-else>
<status v-if="notification.status" class="faint" :compact="true" :statusoid="notification.status" :noHeading="true"></status> <status :activatePanel="activatePanel" v-if="notification.status" class="faint" :compact="true" :statusoid="notification.status" :noHeading="true"></status>
<div class="broken-favorite" v-else> <div class="broken-favorite" v-else>
{{$t('notifications.broken_favorite')}} {{$t('notifications.broken_favorite')}}
</div> </div>

View file

@ -4,6 +4,7 @@ import notificationsFetcher from '../../services/notifications_fetcher/notificat
import { sortBy, filter } from 'lodash' import { sortBy, filter } from 'lodash'
const Notifications = { const Notifications = {
props: [ 'activatePanel' ],
created () { created () {
const store = this.$store const store = this.$store
const credentials = store.state.users.currentUser.credentials const credentials = store.state.users.currentUser.credentials

View file

@ -14,7 +14,7 @@
<div class="panel-body"> <div class="panel-body">
<div v-for="notification in visibleNotifications" :key="notification.action.id" class="notification" :class='{"unseen": !notification.seen}'> <div v-for="notification in visibleNotifications" :key="notification.action.id" class="notification" :class='{"unseen": !notification.seen}'>
<div class="notification-overlay"></div> <div class="notification-overlay"></div>
<notification :notification="notification"></notification> <notification :activatePanel="activatePanel" :notification="notification"></notification>
</div> </div>
</div> </div>
<div class="panel-footer"> <div class="panel-footer">

View file

@ -20,7 +20,8 @@ const Status = {
'replies', 'replies',
'noReplyLinks', 'noReplyLinks',
'noHeading', 'noHeading',
'inlineExpanded' 'inlineExpanded',
'activatePanel'
], ],
data () { data () {
return { return {

View file

@ -54,7 +54,7 @@
</h4> </h4>
</div> </div>
<div class="media-heading-right"> <div class="media-heading-right">
<router-link class="timeago" :to="{ name: 'conversation', params: { id: status.id } }"> <router-link @click.native="activatePanel('timeline')" :to="{ name: 'conversation', params: { id: status.id } }">
<timeago :since="status.created_at" :auto-update="60"></timeago> <timeago :since="status.created_at" :auto-update="60"></timeago>
</router-link> </router-link>
<div class="visibility-icon" v-if="status.visibility"> <div class="visibility-icon" v-if="status.visibility">