This commit is contained in:
syuilo 2018-08-10 00:51:40 +09:00
parent 01d3f5f09d
commit 454d294cf3
2 changed files with 16 additions and 4 deletions

View File

@ -1,6 +1,8 @@
<template> <template>
<router-link class="mk-avatar" :to="user | userPage" :title="user | acct" :target="target" :style="style" v-if="disablePreview"></router-link> <span class="mk-avatar" :title="user | acct" :style="style" v-if="disableLink && !disablePreview" v-user-preview="user.id" @click="onClick"></span>
<router-link class="mk-avatar" :to="user | userPage" :title="user | acct" :target="target" :style="style" v-else v-user-preview="user.id"></router-link> <span class="mk-avatar" :title="user | acct" :style="style" v-else-if="disableLink && disablePreview" @click="onClick"></span>
<router-link class="mk-avatar" :to="user | userPage" :title="user | acct" :target="target" :style="style" v-else-if="!disableLink && !disablePreview" v-user-preview="user.id"></router-link>
<router-link class="mk-avatar" :to="user | userPage" :title="user | acct" :target="target" :style="style" v-else-if="!disableLink && disablePreview"></router-link>
</template> </template>
<script lang="ts"> <script lang="ts">
@ -15,6 +17,10 @@ export default Vue.extend({
required: false, required: false,
default: null default: null
}, },
disableLink: {
required: false,
default: false
},
disablePreview: { disablePreview: {
required: false, required: false,
default: false default: false
@ -35,6 +41,11 @@ export default Vue.extend({
borderRadius: this.$store.state.settings.circleIcons ? '100%' : null borderRadius: this.$store.state.settings.circleIcons ? '100%' : null
}; };
} }
},
methods: {
onClick(e) {
this.$emit('click', e);
}
} }
}); });
</script> </script>

View File

@ -6,10 +6,11 @@
<div class="banner" <div class="banner"
:style="$store.state.i.bannerUrl ? `background-image: url(${$store.state.i.bannerUrl})` : ''" :style="$store.state.i.bannerUrl ? `background-image: url(${$store.state.i.bannerUrl})` : ''"
title="%i18n:@update-banner%" title="%i18n:@update-banner%"
@click="os.apis.updateBanner" @click="() => os.apis.updateBanner()"
></div> ></div>
<mk-avatar class="avatar" :user="$store.state.i" <mk-avatar class="avatar" :user="$store.state.i"
@click="os.apis.updateAvatar" :disable-link="true"
@click="() => os.apis.updateAvatar()"
title="%i18n:@update-avatar%" title="%i18n:@update-avatar%"
/> />
<router-link class="name" :to="$store.state.i | userPage">{{ $store.state.i | userName }}</router-link> <router-link class="name" :to="$store.state.i | userPage">{{ $store.state.i | userName }}</router-link>