diff options
Diffstat (limited to 'core/js')
-rw-r--r-- | core/js/jquery.avatar.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/core/js/jquery.avatar.js b/core/js/jquery.avatar.js index bd57a542fa7..b4fa524f47a 100644 --- a/core/js/jquery.avatar.js +++ b/core/js/jquery.avatar.js @@ -10,6 +10,8 @@ if (typeof(size) === 'undefined') { if (this.height() > 0) { size = this.height(); + } else if (this.data('size') > 0) { + size = this.data('size'); } else { size = 64; } @@ -19,10 +21,17 @@ this.width(size); if (typeof(user) === 'undefined') { - this.placeholder('x'); - return; + if (typeof(this.data('user')) !== 'undefined') { + user = this.data('user'); + } else { + this.placeholder('x'); + return; + } } + // sanitize + user = user.replace(/\//g,''); + var $div = this; //$.get(OC.Router.generate('core_avatar_get', {user: user, size: size}), function(result) { // TODO does not work "Uncaught TypeError: Cannot use 'in' operator to search for 'core_avatar_get' in undefined" router.js L22 |