Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2018-06-28 14:51:01 +0300
committerFatih Acet <acetfatih@gmail.com>2018-06-28 14:51:01 +0300
commitdb2f5786e859347d6c4c5ed1673b7271a3dd988d (patch)
tree546d8a14e68320a748846957913085401921b2cb /app/assets/javascripts/profile
parente4406170c603c80753a95340550c68ec3484dab1 (diff)
parent6cfc5c6a5ed80d2b4fc3793ee08fc47706ecef6d (diff)
Merge branch '39604-update-top-right-avatar-after-changing-avatar' into 'master'
#39604 - Change top-right avatar immediately upon avatar change Closes #39604 See merge request gitlab-org/gitlab-ce!20119
Diffstat (limited to 'app/assets/javascripts/profile')
-rw-r--r--app/assets/javascripts/profile/profile.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/app/assets/javascripts/profile/profile.js b/app/assets/javascripts/profile/profile.js
index 5d58d968d30..8cf7f2f23d0 100644
--- a/app/assets/javascripts/profile/profile.js
+++ b/app/assets/javascripts/profile/profile.js
@@ -61,7 +61,13 @@ export default class Profile {
url: this.form.attr('action'),
data: formData,
})
- .then(({ data }) => flash(data.message, 'notice'))
+ .then(({ data }) => {
+ if (avatarBlob != null) {
+ this.updateHeaderAvatar();
+ }
+
+ flash(data.message, 'notice');
+ })
.then(() => {
window.scrollTo(0, 0);
// Enable submit button after requests ends
@@ -70,6 +76,10 @@ export default class Profile {
.catch(error => flash(error.message));
}
+ updateHeaderAvatar() {
+ $('.header-user-avatar').attr('src', this.avatarGlCrop.dataURL);
+ }
+
setRepoRadio() {
const multiEditRadios = $('input[name="user[multi_file]"]');
if (this.newRepoActivated || this.newRepoActivated === 'true') {