diff options
| author | Shpuld Shpuldson <shp@cock.li> | 2020-07-07 17:34:35 +0300 |
|---|---|---|
| committer | Shpuld Shpuldson <shp@cock.li> | 2020-07-07 17:34:35 +0300 |
| commit | ddde05771fdda8e07ff757c3469ab981ef2be295 (patch) | |
| tree | 6270c5f68038b8e75b340f6d03c69d4e562847c5 /src/components/timeline_menu/timeline_menu.js | |
| parent | 77bb31b474f16aa2bbda66e2aa73cf0d20eb934e (diff) | |
| parent | 7206fee4372eba5bb05db9eb90100aee95003962 (diff) | |
update with bookmarks, clean up some code
Diffstat (limited to 'src/components/timeline_menu/timeline_menu.js')
| -rw-r--r-- | src/components/timeline_menu/timeline_menu.js | 30 |
1 files changed, 20 insertions, 10 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() } } } |
