Commit 7e69e708 authored by Bryce Johnson's avatar Bryce Johnson

Clean up link_to_member_avatar computeds.

parent c0574309
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
props: { props: {
avatarUrl: { avatarUrl: {
type: String, type: String,
required: true, required: false,
default: '/assets/no_avatar.png',
}, },
profileUrl: { profileUrl: {
type: String, type: String,
...@@ -52,7 +53,6 @@ ...@@ -52,7 +53,6 @@
}, },
data() { data() {
return { return {
noAvatarUrl: '/assets/no_avatar.png',
defaultAvatarClass: 'avatar avatar-inline', defaultAvatarClass: 'avatar avatar-inline',
}; };
}, },
...@@ -63,12 +63,6 @@ ...@@ -63,12 +63,6 @@
avatarHtmlClass() { avatarHtmlClass() {
return `${this.avatarSizeClass} ${this.defaultAvatarClass}`; return `${this.avatarSizeClass} ${this.defaultAvatarClass}`;
}, },
avatarElemId() {
return this.username ? `${this.username}-avatar-link` : 'non-user-avatar-link';
},
preppedAvatarUrl() {
return this.avatarUrl || this.noAvatarUrl;
},
tooltipClass() { tooltipClass() {
return this.showTooltip ? 'has-tooltip' : ''; return this.showTooltip ? 'has-tooltip' : '';
}, },
...@@ -82,14 +76,14 @@ ...@@ -82,14 +76,14 @@
return `author_link ${this.tooltipClass} ${this.extraLinkClass} ${this.disabledClass}` return `author_link ${this.tooltipClass} ${this.extraLinkClass} ${this.disabledClass}`
}, },
tooltipContainerAttr() { tooltipContainerAttr() {
return this.tooltipContainer || `#${this.avatarElemId}`; return this.tooltipContainer || 'body';
}, },
}, },
template: ` template: `
<div class='link-to-member-avatar' :id='avatarElemId'> <div class='link-to-member-avatar'>
<a :href='profileUrl' :class='linkClass' :data-original-title='displayName' :data-container='tooltipContainerAttr'> <a :href='profileUrl' :class='linkClass' :data-original-title='displayName' :data-container='tooltipContainerAttr'>
<svg v-if='avatarHtml' v-html='avatarHtml' :class='avatarHtmlClass' :width='size' :height='size' :alt='displayName'></svg> <svg v-if='avatarHtml' v-html='avatarHtml' :class='avatarHtmlClass' :width='size' :height='size' :alt='displayName'></svg>
<img :class='avatarClass' :src='preppedAvatarUrl' :width='size' :height='size' :alt='displayName'/> <img :class='avatarClass' :src='avatarUrl' :width='size' :height='size' :alt='displayName'/>
</a> </a>
</div> </div>
` `
......
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