Merge pull request #7711 from nextcloud/fix-avatar-behaviour

Fix avatar display to not overwrite display style
This commit is contained in:
Morris Jobke 2018-01-08 11:36:57 +01:00 committed by GitHub
commit a30dfc5b50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 6 deletions

View File

@ -110,9 +110,8 @@
// If the new image loads successfully set it.
img.onload = function() {
$div.text('');
$div.append(img);
$div.clearimageplaceholder();
$div.append(img);
if(typeof callback === 'function') {
callback();
@ -127,7 +126,6 @@
$div.imageplaceholder(user, displayname);
} else {
setAvatarForUnknownUser($div);
$div.removeClass('icon-loading');
}
if(typeof callback === 'function') {
@ -136,7 +134,6 @@
};
$div.addClass('icon-loading');
$div.show();
img.width = size;
img.height = size;
img.src = url;

View File

@ -156,6 +156,7 @@
this.css('text-align', '');
this.css('line-height', '');
this.css('font-size', '');
this.html('');
this.removeClass('icon-loading');
};
}(jQuery));

View File

@ -202,8 +202,6 @@ describe('jquery.avatar tests', function() {
expect(window.Image().height).toEqual(32);
expect(window.Image().width).toEqual(32);
expect(window.Image().src).toEqual('http://localhost/index.php/avatar/foo/32');
expect($div.css('display')).toEqual('block');
});
it('callback called', function() {