diff options
author | Tim Zallmann <tzallmann@gitlab.com> | 2018-08-07 06:04:33 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2018-08-07 06:04:33 +0000 |
commit | fac4f50cf6bd923cbf6c5b7a9a69c39e5b2d9181 (patch) | |
tree | 1cf02b46016ae05e488bf5991e724814a919707f /app/assets/javascripts/vue_shared/components/user_avatar | |
parent | dd627072b3f94df0483004425778a99ca369a09f (diff) | |
download | gitlab-ce-fac4f50cf6bd923cbf6c5b7a9a69c39e5b2d9181.tar.gz |
Send resize parameters for avatars
Diffstat (limited to 'app/assets/javascripts/vue_shared/components/user_avatar')
-rw-r--r-- | app/assets/javascripts/vue_shared/components/user_avatar/user_avatar_image.vue | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/assets/javascripts/vue_shared/components/user_avatar/user_avatar_image.vue b/app/assets/javascripts/vue_shared/components/user_avatar/user_avatar_image.vue index 3a413c74410..7737b9f2697 100644 --- a/app/assets/javascripts/vue_shared/components/user_avatar/user_avatar_image.vue +++ b/app/assets/javascripts/vue_shared/components/user_avatar/user_avatar_image.vue @@ -1,5 +1,4 @@ <script> - /* This is a re-usable vue component for rendering a user avatar that does not need to link to the user's profile. The image and an optional tooltip can be configured by props passed to this component. @@ -67,7 +66,9 @@ export default { // we provide an empty string when we use it inside user avatar link. // In both cases we should render the defaultAvatarUrl sanitizedSource() { - return this.imgSrc === '' || this.imgSrc === null ? defaultAvatarUrl : this.imgSrc; + let baseSrc = this.imgSrc === '' || this.imgSrc === null ? defaultAvatarUrl : this.imgSrc; + if (baseSrc.indexOf('?') === -1) baseSrc += `?width=${this.size}`; + return baseSrc; }, resultantSrcAttribute() { return this.lazy ? placeholderImage : this.sanitizedSource; |