summaryrefslogtreecommitdiffstats
path: root/core/js/jquery.avatar.js
diff options
context:
space:
mode:
Diffstat (limited to 'core/js/jquery.avatar.js')
-rw-r--r--core/js/jquery.avatar.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/core/js/jquery.avatar.js b/core/js/jquery.avatar.js
index c8ac70ac692..fae100fda21 100644
--- a/core/js/jquery.avatar.js
+++ b/core/js/jquery.avatar.js
@@ -48,6 +48,11 @@
(function ($) {
$.fn.avatar = function(user, size, ie8fix, hidedefault, callback, displayname) {
+ var setAvatarForUnknownUser = function(target) {
+ target.imageplaceholder('?');
+ target.css('background-color', '#b9b9b9');
+ };
+
if (typeof(user) !== 'undefined') {
user = String(user);
}
@@ -72,8 +77,7 @@
if (typeof(this.data('user')) !== 'undefined') {
user = this.data('user');
} else {
- this.imageplaceholder('?');
- this.css('background-color', '#b9b9b9');
+ setAvatarForUnknownUser(this);
return;
}
}
@@ -113,8 +117,7 @@
$div.imageplaceholder(user, result.data.displayname);
} else {
// User does not exist
- $div.imageplaceholder('?');
- $div.css('background-color', '#b9b9b9');
+ setAvatarForUnknownUser($div);
}
} else {
$div.hide();