diff options
Diffstat (limited to 'src/components/timeline_menu')
| -rw-r--r-- | src/components/timeline_menu/timeline_menu.js | 30 | ||||
| -rw-r--r-- | src/components/timeline_menu/timeline_menu.vue | 7 |
2 files changed, 26 insertions, 11 deletions
diff --git a/src/components/timeline_menu/timeline_menu.js b/src/components/timeline_menu/timeline_menu.js index d35b7789..02c1318d 100644 --- a/src/components/timeline_menu/timeline_menu.js +++ b/src/components/timeline_menu/timeline_menu.js @@ -1,6 +1,18 @@ import Popover from '../popover/popover.vue' import { mapState } from 'vuex' +// Route -> i18n key mapping, exported andnot in the computed +// because nav panel benefits from the same information. +export const timelineNames = () => { + return { + 'friends': 'nav.timeline', + 'bookmarks': 'nav.bookmarks', + 'dms': 'nav.dms', + 'public-timeline': 'nav.public_tl', + 'public-external-timeline': 'nav.twkn' + } +} + const TimelineMenu = { components: { Popover @@ -17,11 +29,14 @@ const TimelineMenu = { }, methods: { openMenu () { - // Tried using $nextTick, but the animation wouldn't - // play, I assume it played too quickly + // $nextTick is too fast, animation won't play back but + // instead starts in fully open position. Low values + // like 1-5 work on fast machines but not on mobile, 25 + // seems like a good compromise that plays without significant + // added lag. setTimeout(() => { this.isOpen = true - }, 1) + }, 25) } }, computed: { @@ -30,13 +45,8 @@ const TimelineMenu = { privateMode: state => state.instance.private, federating: state => state.instance.federating }), - timelineNamesForRoute () { - return { - 'friends': this.$t('nav.timeline'), - 'dms': this.$t('nav.dms'), - 'public-timeline': this.$t('nav.public_tl'), - 'public-external-timeline': this.$t('nav.twkn') - } + timelineNames () { + return timelineNames() } } } diff --git a/src/components/timeline_menu/timeline_menu.vue b/src/components/timeline_menu/timeline_menu.vue index 9cb40262..e30bfe34 100644 --- a/src/components/timeline_menu/timeline_menu.vue +++ b/src/components/timeline_menu/timeline_menu.vue @@ -20,6 +20,11 @@ </router-link> </li> <li v-if="currentUser"> + <router-link :to="{ name: 'bookmarks'}"> + <i class="button-icon icon-bookmark" />{{ $t("nav.bookmarks") }} + </router-link> + </li> + <li v-if="currentUser"> <router-link :to="{ name: 'dms', params: { username: currentUser.screen_name } }"> <i class="button-icon icon-mail-alt" />{{ $t("nav.dms") }} </router-link> @@ -40,7 +45,7 @@ slot="trigger" class="title timeline-menu-title" > - <span>{{ timelineNamesForRoute[$route.name] }}</span> + <span>{{ $t(timelineNames[$route.name]) }}</span> <i class="icon-down-open" /> </div> </Popover> |
