2020-07-02 15:03:02 +00:00
|
|
|
<template>
|
|
|
|
<Popover
|
|
|
|
trigger="click"
|
2020-10-19 16:38:49 +00:00
|
|
|
class="TimelineMenu"
|
2020-07-03 09:56:31 +00:00
|
|
|
:class="{ 'open': isOpen }"
|
|
|
|
:margin="{ left: -15, right: -200 }"
|
|
|
|
:bound-to="{ x: 'container' }"
|
|
|
|
popover-class="timeline-menu-popover-wrap"
|
|
|
|
@show="openMenu"
|
|
|
|
@close="() => isOpen = false"
|
2020-07-02 15:03:02 +00:00
|
|
|
>
|
2020-07-03 09:56:31 +00:00
|
|
|
<div
|
|
|
|
slot="content"
|
|
|
|
class="timeline-menu-popover panel panel-default"
|
|
|
|
>
|
2020-07-02 15:03:02 +00:00
|
|
|
<ul>
|
|
|
|
<li v-if="currentUser">
|
|
|
|
<router-link :to="{ name: 'friends' }">
|
2020-10-19 16:38:49 +00:00
|
|
|
<FAIcon fixed-width size="lg" class="button-icon " icon="home" />{{ $t("nav.timeline") }}
|
2020-07-02 15:03:02 +00:00
|
|
|
</router-link>
|
|
|
|
</li>
|
2020-07-07 14:34:35 +00:00
|
|
|
<li v-if="currentUser">
|
|
|
|
<router-link :to="{ name: 'bookmarks'}">
|
2020-10-19 16:38:49 +00:00
|
|
|
<FAIcon fixed-width size="lg" class="button-icon " icon="bookmark" />{{ $t("nav.bookmarks") }}
|
2020-07-07 14:34:35 +00:00
|
|
|
</router-link>
|
|
|
|
</li>
|
2020-07-02 15:03:02 +00:00
|
|
|
<li v-if="currentUser">
|
|
|
|
<router-link :to="{ name: 'dms', params: { username: currentUser.screen_name } }">
|
2020-10-19 16:38:49 +00:00
|
|
|
<FAIcon fixed-width size="lg" class="button-icon " icon="envelope" />{{ $t("nav.dms") }}
|
2020-07-02 15:03:02 +00:00
|
|
|
</router-link>
|
|
|
|
</li>
|
|
|
|
<li v-if="currentUser || !privateMode">
|
|
|
|
<router-link :to="{ name: 'public-timeline' }">
|
2020-10-19 16:38:49 +00:00
|
|
|
<FAIcon fixed-width size="lg" class="button-icon " icon="users" />{{ $t("nav.public_tl") }}
|
2020-07-02 15:03:02 +00:00
|
|
|
</router-link>
|
|
|
|
</li>
|
|
|
|
<li v-if="federating && (currentUser || !privateMode)">
|
|
|
|
<router-link :to="{ name: 'public-external-timeline' }">
|
2020-10-20 21:25:59 +00:00
|
|
|
<FAIcon fixed-width size="lg" class="button-icon " icon="globe" />{{ $t("nav.twkn") }}
|
2020-07-02 15:03:02 +00:00
|
|
|
</router-link>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<div
|
|
|
|
slot="trigger"
|
|
|
|
class="title timeline-menu-title"
|
|
|
|
>
|
2020-08-19 10:06:46 +00:00
|
|
|
<span>{{ timelineName() }}</span>
|
2020-10-19 16:38:49 +00:00
|
|
|
<FAIcon size="sm" icon="chevron-down" />
|
2020-07-02 15:03:02 +00:00
|
|
|
</div>
|
|
|
|
</Popover>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script src="./timeline_menu.js" ></script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
@import '../../_variables.scss';
|
|
|
|
|
2020-10-19 16:38:49 +00:00
|
|
|
.TimelineMenu {
|
2020-07-03 09:56:31 +00:00
|
|
|
flex-shrink: 1;
|
|
|
|
margin-right: auto;
|
|
|
|
min-width: 0;
|
|
|
|
width: 24rem;
|
2020-10-19 16:38:49 +00:00
|
|
|
|
2020-07-03 09:56:31 +00:00
|
|
|
.timeline-menu-popover-wrap {
|
|
|
|
overflow: hidden;
|
2020-07-09 09:49:16 +00:00
|
|
|
// Match panel heading padding to line up menu with bottom of heading
|
2020-09-29 11:20:16 +00:00
|
|
|
margin-top: 0.6rem;
|
2020-07-03 09:56:31 +00:00
|
|
|
padding: 0 15px 15px 15px;
|
|
|
|
}
|
2020-10-19 16:38:49 +00:00
|
|
|
|
2020-07-02 15:03:02 +00:00
|
|
|
.timeline-menu-popover {
|
2020-07-03 09:56:31 +00:00
|
|
|
width: 24rem;
|
|
|
|
max-width: 100vw;
|
|
|
|
margin: 0;
|
2020-07-02 15:03:02 +00:00
|
|
|
font-size: 1rem;
|
2020-07-03 09:56:31 +00:00
|
|
|
border-top-right-radius: 0;
|
|
|
|
border-top-left-radius: 0;
|
|
|
|
transform: translateY(-100%);
|
|
|
|
transition: transform 100ms;
|
|
|
|
}
|
2020-10-19 16:38:49 +00:00
|
|
|
|
2020-07-03 09:56:31 +00:00
|
|
|
.panel::after {
|
|
|
|
border-top-right-radius: 0;
|
|
|
|
border-top-left-radius: 0;
|
|
|
|
}
|
2020-10-19 16:38:49 +00:00
|
|
|
|
2020-07-03 09:56:31 +00:00
|
|
|
&.open .timeline-menu-popover {
|
|
|
|
transform: translateY(0);
|
2020-07-02 15:03:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.timeline-menu-title {
|
|
|
|
margin: 0;
|
2020-07-03 09:56:31 +00:00
|
|
|
cursor: pointer;
|
|
|
|
user-select: none;
|
|
|
|
width: 100%;
|
|
|
|
|
|
|
|
span {
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
white-space: nowrap;
|
|
|
|
}
|
|
|
|
|
2020-10-19 16:38:49 +00:00
|
|
|
svg {
|
2020-07-03 09:56:31 +00:00
|
|
|
margin-left: 0.6em;
|
|
|
|
transition: transform 100ms;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-19 16:38:49 +00:00
|
|
|
&.open .timeline-menu-title svg {
|
2020-07-03 09:56:31 +00:00
|
|
|
color: $fallback--text;
|
|
|
|
color: var(--panelText, $fallback--text);
|
|
|
|
transform: rotate(180deg);
|
|
|
|
}
|
|
|
|
|
|
|
|
.panel {
|
|
|
|
box-shadow: var(--popoverShadow);
|
|
|
|
}
|
|
|
|
|
|
|
|
ul {
|
|
|
|
list-style: none;
|
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
li {
|
|
|
|
border-bottom: 1px solid;
|
|
|
|
border-color: $fallback--border;
|
|
|
|
border-color: var(--border, $fallback--border);
|
|
|
|
padding: 0;
|
|
|
|
|
|
|
|
&:last-child a {
|
|
|
|
border-bottom-right-radius: $fallback--panelRadius;
|
|
|
|
border-bottom-right-radius: var(--panelRadius, $fallback--panelRadius);
|
|
|
|
border-bottom-left-radius: $fallback--panelRadius;
|
|
|
|
border-bottom-left-radius: var(--panelRadius, $fallback--panelRadius);
|
|
|
|
}
|
|
|
|
|
|
|
|
&:last-child {
|
|
|
|
border: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
a {
|
|
|
|
display: block;
|
2020-09-29 11:20:16 +00:00
|
|
|
padding: 0.6em 0.65em;
|
2020-07-03 09:56:31 +00:00
|
|
|
|
|
|
|
&:hover {
|
|
|
|
background-color: $fallback--lightBg;
|
|
|
|
background-color: var(--selectedMenu, $fallback--lightBg);
|
|
|
|
color: $fallback--link;
|
|
|
|
color: var(--selectedMenuText, $fallback--link);
|
|
|
|
--faint: var(--selectedMenuFaintText, $fallback--faint);
|
|
|
|
--faintLink: var(--selectedMenuFaintLink, $fallback--faint);
|
|
|
|
--lightText: var(--selectedMenuLightText, $fallback--lightText);
|
|
|
|
--icon: var(--selectedMenuIcon, $fallback--icon);
|
|
|
|
}
|
|
|
|
|
|
|
|
&.router-link-active {
|
|
|
|
font-weight: bolder;
|
|
|
|
background-color: $fallback--lightBg;
|
|
|
|
background-color: var(--selectedMenu, $fallback--lightBg);
|
|
|
|
color: $fallback--text;
|
|
|
|
color: var(--selectedMenuText, $fallback--text);
|
|
|
|
--faint: var(--selectedMenuFaintText, $fallback--faint);
|
|
|
|
--faintLink: var(--selectedMenuFaintLink, $fallback--faint);
|
|
|
|
--lightText: var(--selectedMenuLightText, $fallback--lightText);
|
|
|
|
--icon: var(--selectedMenuIcon, $fallback--icon);
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
text-decoration: underline;
|
|
|
|
}
|
|
|
|
}
|
2020-09-29 11:13:42 +00:00
|
|
|
|
2020-10-19 16:38:49 +00:00
|
|
|
svg {
|
|
|
|
margin-right: 0.4em;
|
|
|
|
margin-left: -0.2em;
|
2020-09-29 11:13:42 +00:00
|
|
|
}
|
2020-07-02 15:03:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
</style>
|