Commit 4f743926 authored by Tae Hoon's avatar Tae Hoon

rewrite ModerationTools using v-tooltip

parent b9c54782
import DialogModal from '../dialog_modal/dialog_modal.vue' import DialogModal from '../dialog_modal/dialog_modal.vue'
import Popper from 'vue-popperjs/src/component/popper.js.vue'
const FORCE_NSFW = 'mrf_tag:media-force-nsfw' const FORCE_NSFW = 'mrf_tag:media-force-nsfw'
const STRIP_MEDIA = 'mrf_tag:media-strip' const STRIP_MEDIA = 'mrf_tag:media-strip'
...@@ -29,8 +28,7 @@ const ModerationTools = { ...@@ -29,8 +28,7 @@ const ModerationTools = {
} }
}, },
components: { components: {
DialogModal, DialogModal
Popper
}, },
computed: { computed: {
tagsSet () { tagsSet () {
...@@ -41,9 +39,6 @@ const ModerationTools = { ...@@ -41,9 +39,6 @@ const ModerationTools = {
} }
}, },
methods: { methods: {
toggleMenu () {
this.showDropDown = !this.showDropDown
},
hasTag (tagName) { hasTag (tagName) {
return this.tagsSet.has(tagName) return this.tagsSet.has(tagName)
}, },
......
<template> <template>
<div> <div>
<Popper <v-popover
trigger="click" trigger="click"
append-to-body class="moderation-tools-popover"
:options="{ :container="false"
placement: 'bottom-end', @show="showDropDown = true"
modifiers: {
arrow: { enabled: true },
offset: { offset: '0, 5px' },
}
}"
@hide="showDropDown = false" @hide="showDropDown = false"
> >
<div class="popper-wrapper"> <div class="popper-wrapper" slot="popover">
<div class="dropdown-menu"> <div class="dropdown-menu">
<span v-if="user.is_local"> <span v-if="user.is_local">
<button <button
...@@ -127,14 +122,12 @@ ...@@ -127,14 +122,12 @@
</div> </div>
</div> </div>
<button <button
slot="reference"
class="btn btn-default btn-block" class="btn btn-default btn-block"
:class="{ pressed: showDropDown }" :class="{ pressed: showDropDown }"
@click="toggleMenu"
> >
{{ $t('user_card.admin_menu.moderation') }} {{ $t('user_card.admin_menu.moderation') }}
</button> </button>
</Popper> </v-popover>
<portal to="modal"> <portal to="modal">
<DialogModal <DialogModal
v-if="showDeleteUserDialog" v-if="showDeleteUserDialog"
...@@ -188,4 +181,11 @@ ...@@ -188,4 +181,11 @@
} }
} }
.moderation-tools-popover {
height: 100%;
.trigger {
display: flex !important;
height: 100%;
}
}
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment