diff --git a/app/assets/javascripts/discourse/components/avatar-uploader.js.es6 b/app/assets/javascripts/discourse/components/avatar-uploader.js.es6 index 353fb5a4c5b..f711802a409 100644 --- a/app/assets/javascripts/discourse/components/avatar-uploader.js.es6 +++ b/app/assets/javascripts/discourse/components/avatar-uploader.js.es6 @@ -19,6 +19,7 @@ export default Em.Component.extend(UploadMixin, { // display a warning whenever the image is not a square this.set("imageIsNotASquare", data.result.width !== data.result.height); + // in order to be as much responsive as possible, we're cheating a bit here // indeed, the server gives us back the url to the file we've just uploaded // often, this file is not a square, so we need to crop it properly @@ -26,5 +27,8 @@ export default Em.Component.extend(UploadMixin, { Discourse.Utilities.cropAvatar(data.result.url, data.files[0].type).then(function(avatarTemplate) { self.set("uploadedAvatarTemplate", avatarTemplate); }); + + // the upload is now done + this.sendAction("done"); } }); diff --git a/app/assets/javascripts/discourse/templates/modal/avatar_selector.hbs b/app/assets/javascripts/discourse/templates/modal/avatar_selector.hbs index de3ca91c56a..caad9187acd 100644 --- a/app/assets/javascripts/discourse/templates/modal/avatar_selector.hbs +++ b/app/assets/javascripts/discourse/templates/modal/avatar_selector.hbs @@ -24,7 +24,8 @@ {{avatar-uploader username=username uploadedAvatarTemplate=view.uploadedAvatarTemplate - custom_avatar_upload_id=controller.custom_avatar_upload_id}} + custom_avatar_upload_id=controller.custom_avatar_upload_id + done="useUploadedAvatar"}} diff --git a/app/assets/javascripts/discourse/templates/user/preferences.hbs b/app/assets/javascripts/discourse/templates/user/preferences.hbs index 2e6dd5cbce3..bb39d301a5a 100644 --- a/app/assets/javascripts/discourse/templates/user/preferences.hbs +++ b/app/assets/javascripts/discourse/templates/user/preferences.hbs @@ -89,10 +89,12 @@
{{bound-avatar model "large"}} {{#if allowAvatarUpload}} - - {{else}} {{#unless ssoOverridesAvatar}} - - {{/unless}} {{/if}} + + {{else}} + {{#unless ssoOverridesAvatar}} + {{fa-icon "pencil"}} + {{/unless}} + {{/if}}