Merge pull request #11428 from michag86/patch-1

fix for issue #10483
This commit is contained in:
Morris Jobke 2014-10-07 15:00:31 +02:00
commit 432cd4a5c2
1 changed files with 6 additions and 3 deletions

View File

@ -616,13 +616,16 @@ $(document).ready(function () {
.keypress(function (event) {
if (event.keyCode === 13) {
if ($(this).val().length > 0) {
$tr.find('.avatardiv').imageplaceholder(uid, displayName);
var $div = $tr.find('div.avatardiv');
if ($div.length) {
$div.imageplaceholder(uid, displayName);
}
$.post(
OC.filePath('settings', 'ajax', 'changedisplayname.php'),
{username: uid, displayName: $(this).val()},
function (result) {
if (result && result.status==='success'){
$tr.find('.avatardiv').avatar(result.data.username, 32);
if (result && result.status==='success' && $div.length){
$div.avatar(result.data.username, 32);
}
}
);