Fix: user menu (#4845) (#4920)

* Fix: Firefoxで自分のメニューが開けないなど

* 自分のユーザーメニューにはミュートなどを表示しないようになど
This commit is contained in:
MeiMei 2019-05-14 02:53:05 +09:00 committed by syuilo
parent 342e48ed77
commit b128b593c2
2 changed files with 18 additions and 26 deletions

View File

@ -7,7 +7,6 @@
<script lang="ts"> <script lang="ts">
import Vue from 'vue'; import Vue from 'vue';
import i18n from '../../../i18n'; import i18n from '../../../i18n';
import copyToClipboard from '../../../common/scripts/copy-to-clipboard';
import { faExclamationCircle, faMicrophoneSlash } from '@fortawesome/free-solid-svg-icons'; import { faExclamationCircle, faMicrophoneSlash } from '@fortawesome/free-solid-svg-icons';
import { faSnowflake } from '@fortawesome/free-regular-svg-icons'; import { faSnowflake } from '@fortawesome/free-regular-svg-icons';
@ -27,19 +26,23 @@ export default Vue.extend({
icon: ['fas', 'list'], icon: ['fas', 'list'],
text: this.$t('push-to-list'), text: this.$t('push-to-list'),
action: this.pushList action: this.pushList
}, null, { }] as any;
icon: this.user.isMuted ? ['fas', 'eye'] : ['far', 'eye-slash'],
text: this.user.isMuted ? this.$t('unmute') : this.$t('mute'), if (this.$store.getters.isSignedIn && this.$store.state.i.id != this.user.id) {
action: this.toggleMute menu = menu.concat([null, {
}, { icon: this.user.isMuted ? ['fas', 'eye'] : ['far', 'eye-slash'],
icon: 'ban', text: this.user.isMuted ? this.$t('unmute') : this.$t('mute'),
text: this.user.isBlocking ? this.$t('unblock') : this.$t('block'), action: this.toggleMute
action: this.toggleBlock }, {
}, null, { icon: 'ban',
icon: faExclamationCircle, text: this.user.isBlocking ? this.$t('unblock') : this.$t('block'),
text: this.$t('report-abuse'), action: this.toggleBlock
action: this.reportAbuse }, null, {
}]; icon: faExclamationCircle,
text: this.$t('report-abuse'),
action: this.reportAbuse
}]);
}
if (this.$store.getters.isSignedIn && (this.$store.state.i.isAdmin || this.$store.state.i.isModerator)) { if (this.$store.getters.isSignedIn && (this.$store.state.i.isAdmin || this.$store.state.i.isModerator)) {
menu = menu.concat([null, { menu = menu.concat([null, {

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="header" :class="{ shadow: $store.state.device.useShadow, round: $store.state.device.roundedCorners }"> <div class="header" :class="{ shadow: $store.state.device.useShadow, round: $store.state.device.roundedCorners }">
<div class="banner-container" :style="style"> <div class="banner-container" :style="style">
<div class="banner" ref="banner" :style="style" @click="onBannerClick"></div> <div class="banner" ref="banner" :style="style"></div>
<div class="fade"></div> <div class="fade"></div>
<div class="title"> <div class="title">
<p class="name"> <p class="name">
@ -105,14 +105,6 @@ export default Vue.extend({
if (blur <= 10) banner.style.filter = `blur(${blur}px)`; if (blur <= 10) banner.style.filter = `blur(${blur}px)`;
}, },
onBannerClick() {
if (!this.$store.getters.isSignedIn || this.$store.state.i.id != this.user.id) return;
this.$updateBanner().then(i => {
this.user.bannerUrl = i.bannerUrl;
});
},
menu() { menu() {
this.$root.new(XUserMenu, { this.$root.new(XUserMenu, {
source: this.$refs.menu, source: this.$refs.menu,
@ -171,9 +163,6 @@ export default Vue.extend({
> .menu > .menu
height 100% height 100%
display block
position absolute
left -42px
padding 0 14px padding 0 14px
color #fff color #fff
text-shadow 0 0 8px #000 text-shadow 0 0 8px #000