pleroma-fe/src/components/extra_buttons/extra_buttons.vue

134 lines
3.3 KiB
Vue
Raw Normal View History

<template>
2020-02-28 16:39:47 +00:00
<Popover
trigger="click"
2019-07-11 15:01:12 +00:00
placement="top"
2019-07-11 12:31:02 +00:00
class="extra-button-popover"
:bound-to="{ x: 'container' }"
>
<div
slot="content"
slot-scope="{close}"
>
2019-05-26 21:13:08 +00:00
<div class="dropdown-menu">
<button
v-if="canMute && !status.thread_muted"
class="dropdown-item dropdown-item-icon"
@click.prevent="muteConversation"
>
2020-10-20 21:31:16 +00:00
<FAIcon
size="md"
fixed-width
icon="eye-slash"
/><span>{{ $t("status.mute_conversation") }}</span>
</button>
<button
v-if="canMute && status.thread_muted"
class="dropdown-item dropdown-item-icon"
@click.prevent="unmuteConversation"
>
2020-10-20 21:31:16 +00:00
<FAIcon
size="md"
fixed-width
icon="eye-slash"
/><span>{{ $t("status.unmute_conversation") }}</span>
</button>
2019-07-05 07:17:44 +00:00
<button
v-if="!status.pinned && canPin"
class="dropdown-item dropdown-item-icon"
@click.prevent="pinStatus"
@click="close"
2019-07-05 07:17:44 +00:00
>
2020-10-20 21:31:16 +00:00
<FAIcon
size="md"
fixed-width
icon="thumbtack"
/><span>{{ $t("status.pin") }}</span>
</button>
2019-07-05 07:17:44 +00:00
<button
v-if="status.pinned && canPin"
class="dropdown-item dropdown-item-icon"
@click.prevent="unpinStatus"
@click="close"
2019-07-05 07:17:44 +00:00
>
2020-10-20 21:31:16 +00:00
<FAIcon
size="md"
fixed-width
icon="thumbtack"
/><span>{{ $t("status.unpin") }}</span>
</button>
<button
v-if="!status.bookmarked"
class="dropdown-item dropdown-item-icon"
@click.prevent="bookmarkStatus"
@click="close"
>
2020-10-20 21:31:16 +00:00
<FAIcon
size="md"
fixed-width
:icon="['far', 'bookmark']"
/><span>{{ $t("status.bookmark") }}</span>
</button>
<button
v-if="status.bookmarked"
class="dropdown-item dropdown-item-icon"
@click.prevent="unbookmarkStatus"
@click="close"
>
2020-10-20 21:31:16 +00:00
<FAIcon
size="md"
fixed-width
icon="bookmark"
/><span>{{ $t("status.unbookmark") }}</span>
</button>
2019-07-05 07:17:44 +00:00
<button
v-if="canDelete"
class="dropdown-item dropdown-item-icon"
@click.prevent="deleteStatus"
@click="close"
2019-07-05 07:17:44 +00:00
>
2020-10-20 21:31:16 +00:00
<FAIcon
size="md"
fixed-width
icon="times"
/><span>{{ $t("status.delete") }}</span>
</button>
<button
class="dropdown-item dropdown-item-icon"
@click.prevent="copyLink"
@click="close"
>
2020-10-20 21:31:16 +00:00
<FAIcon
size="md"
fixed-width
icon="share-alt"
/><span>{{ $t("status.copy_link") }}</span>
</button>
</div>
</div>
<span slot="trigger">
<FAIcon
class="ExtraButtons button-icon"
icon="ellipsis-h"
size="md"
/>
</span>
2020-02-28 16:39:47 +00:00
</Popover>
</template>
<script src="./extra_buttons.js" ></script>
<style lang="scss">
@import '../../_variables.scss';
.ExtraButtons {
cursor: pointer;
position: static;
2019-07-11 12:31:02 +00:00
&:hover,
.extra-button-popover.open & {
2019-04-26 20:30:04 +00:00
color: $fallback--text;
color: var(--text, $fallback--text);
}
}
</style>