aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/avatar/controller.php2
-rw-r--r--core/js/jquery.avatar.js6
-rw-r--r--settings/js/personal.js1
3 files changed, 7 insertions, 2 deletions
diff --git a/core/avatar/controller.php b/core/avatar/controller.php
index 9f7c0517c4a..22693824461 100644
--- a/core/avatar/controller.php
+++ b/core/avatar/controller.php
@@ -33,7 +33,7 @@ class Controller {
$image->show();
} else {
// Signalizes $.avatar() to display a defaultavatar
- \OC_JSON::success();
+ \OC_JSON::success(array("data"=> array("displayname"=> \OC_User::getDisplayName($user)) ));
}
}
diff --git a/core/js/jquery.avatar.js b/core/js/jquery.avatar.js
index f1382fd7d2d..88a4c25d1ee 100644
--- a/core/js/jquery.avatar.js
+++ b/core/js/jquery.avatar.js
@@ -69,7 +69,11 @@
var url = OC.Router.generate('core_avatar_get', {user: user, size: size})+'?requesttoken='+oc_requesttoken;
$.get(url, function(result) {
if (typeof(result) === 'object') {
- $div.placeholder(user);
+ if (result.data && result.data.displayname) {
+ $div.placeholder(user, result.data.displayname);
+ } else {
+ $div.placeholder(user);
+ }
} else {
if (ie8fix === true) {
$div.html('<img src="'+url+'#'+Math.floor(Math.random()*1000)+'">');
diff --git a/settings/js/personal.js b/settings/js/personal.js
index eaaca32f5d8..8944a7afa3c 100644
--- a/settings/js/personal.js
+++ b/settings/js/personal.js
@@ -34,6 +34,7 @@ function changeDisplayName(){
$('#oldDisplayName').text($('#displayName').val());
// update displayName on the top right expand button
$('#expandDisplayName').text($('#displayName').val());
+ updateAvatar();
}
else{
$('#newdisplayname').val(data.data.displayName);