Show default placeholder if avatar image can't be fetched
* fixes owncloud/documents#601 * ref #14564
This commit is contained in:
parent
dd733d8925
commit
b188de242e
|
@ -81,8 +81,10 @@
|
||||||
|
|
||||||
// If the displayname is not defined we use the old code path
|
// If the displayname is not defined we use the old code path
|
||||||
if (typeof(displayname) === 'undefined') {
|
if (typeof(displayname) === 'undefined') {
|
||||||
$.get(url, function(result) {
|
$.get(url).always(function(result, status) {
|
||||||
if (typeof(result) === 'object') {
|
// if there is an error or an object returned (contains user information):
|
||||||
|
// -> show the fallback placeholder
|
||||||
|
if (typeof(result) === 'object' || status === 'error') {
|
||||||
if (!hidedefault) {
|
if (!hidedefault) {
|
||||||
if (result.data && result.data.displayname) {
|
if (result.data && result.data.displayname) {
|
||||||
$div.imageplaceholder(user, result.data.displayname);
|
$div.imageplaceholder(user, result.data.displayname);
|
||||||
|
@ -94,6 +96,7 @@
|
||||||
} else {
|
} else {
|
||||||
$div.hide();
|
$div.hide();
|
||||||
}
|
}
|
||||||
|
// else an image is transferred and should be shown
|
||||||
} else {
|
} else {
|
||||||
$div.show();
|
$div.show();
|
||||||
if (ie8fix === true) {
|
if (ie8fix === true) {
|
||||||
|
|
Loading…
Reference in New Issue