variable for found avatar div

This commit is contained in:
michag86 2014-10-07 10:44:36 +02:00
parent 2849c75646
commit f4a2ddbe31
1 changed files with 5 additions and 4 deletions

View File

@ -616,15 +616,16 @@ $(document).ready(function () {
.keypress(function (event) {
if (event.keyCode === 13) {
if ($(this).val().length > 0) {
if ($tr.find('div.avatardiv').length) {
$tr.find('.avatardiv').imageplaceholder(uid, displayName);
$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('div.avatardiv').length){
$tr.find('.avatardiv').avatar(result.data.username, 32);
if (result && result.status==='success' && $div.length){
$div.avatar(result.data.username, 32);
}
}
);