From 1623dcb417360ce9304c84d679cc856ad1311a69 Mon Sep 17 00:00:00 2001 From: ValD <maghtpol@gmail.com> Date: Tue, 11 Dec 2018 01:42:51 +0530 Subject: [PATCH] added activatePanel onclick for timeago button --- src/App.vue | 2 +- src/components/notification/notification.js | 3 ++- src/components/notification/notification.vue | 4 ++-- src/components/notifications/notifications.js | 1 + src/components/notifications/notifications.vue | 2 +- src/components/status/status.js | 3 ++- src/components/status/status.vue | 2 +- 7 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/App.vue b/src/App.vue index 9d66b9d4b..16cd08d47 100644 --- a/src/App.vue +++ b/src/App.vue @@ -30,7 +30,7 @@ <instance-specific-panel v-if="showInstanceSpecificPanel"></instance-specific-panel> <features-panel v-if="!currentUser"></features-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> diff --git a/src/components/notification/notification.js b/src/components/notification/notification.js index 4dea63bb8..345fe3ee0 100644 --- a/src/components/notification/notification.js +++ b/src/components/notification/notification.js @@ -11,7 +11,8 @@ const Notification = { } }, props: [ - 'notification' + 'notification', + 'activatePanel' ], components: { Status, StillImage, UserCardContent diff --git a/src/components/notification/notification.vue b/src/components/notification/notification.vue index f773d9dec..a9d724e3c 100644 --- a/src/components/notification/notification.vue +++ b/src/components/notification/notification.vue @@ -1,5 +1,5 @@ <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> <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"/> @@ -31,7 +31,7 @@ <router-link :to="{ name: 'user-profile', params: { id: notification.action.user.id } }">@{{notification.action.user.screen_name}}</router-link> </div> <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> {{$t('notifications.broken_favorite')}} </div> diff --git a/src/components/notifications/notifications.js b/src/components/notifications/notifications.js index 945ffd1fb..4b7a591d0 100644 --- a/src/components/notifications/notifications.js +++ b/src/components/notifications/notifications.js @@ -4,6 +4,7 @@ import notificationsFetcher from '../../services/notifications_fetcher/notificat import { sortBy, filter } from 'lodash' const Notifications = { + props: [ 'activatePanel' ], created () { const store = this.$store const credentials = store.state.users.currentUser.credentials diff --git a/src/components/notifications/notifications.vue b/src/components/notifications/notifications.vue index 64f187209..bef485679 100644 --- a/src/components/notifications/notifications.vue +++ b/src/components/notifications/notifications.vue @@ -14,7 +14,7 @@ <div class="panel-body"> <div v-for="notification in visibleNotifications" :key="notification.action.id" class="notification" :class='{"unseen": !notification.seen}'> <div class="notification-overlay"></div> - <notification :notification="notification"></notification> + <notification :activatePanel="activatePanel" :notification="notification"></notification> </div> </div> <div class="panel-footer"> diff --git a/src/components/status/status.js b/src/components/status/status.js index cb125e452..9a63d047a 100644 --- a/src/components/status/status.js +++ b/src/components/status/status.js @@ -20,7 +20,8 @@ const Status = { 'replies', 'noReplyLinks', 'noHeading', - 'inlineExpanded' + 'inlineExpanded', + 'activatePanel' ], data () { return { diff --git a/src/components/status/status.vue b/src/components/status/status.vue index c28c94737..67b7cb448 100644 --- a/src/components/status/status.vue +++ b/src/components/status/status.vue @@ -54,7 +54,7 @@ </h4> </div> <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> </router-link> <div class="visibility-icon" v-if="status.visibility"> -- GitLab