diff options
author | kondou <kondou@ts.unde.re> | 2013-09-01 16:04:39 +0200 |
---|---|---|
committer | kondou <kondou@ts.unde.re> | 2013-09-01 16:04:39 +0200 |
commit | f44cd944e07cdd908d54f0bc3251e7e9be2ad7f8 (patch) | |
tree | b3dcdc2a4f10d1e5d9aac18e51a2e6b29e289975 /core/js/jquery.avatar.js | |
parent | 8de9e3d85ede3b9b6abf166a89c501624d634adc (diff) | |
download | nextcloud-server-f44cd944e07cdd908d54f0bc3251e7e9be2ad7f8.tar.gz nextcloud-server-f44cd944e07cdd908d54f0bc3251e7e9be2ad7f8.zip |
Better naming than "ava" & "data", cache timeout, use OC.Router.registerLoadedCallback()
Diffstat (limited to 'core/js/jquery.avatar.js')
-rw-r--r-- | core/js/jquery.avatar.js | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/core/js/jquery.avatar.js b/core/js/jquery.avatar.js index 055ca457205..dc73d8f0d91 100644 --- a/core/js/jquery.avatar.js +++ b/core/js/jquery.avatar.js @@ -61,13 +61,15 @@ var $div = this; - var url = OC.router_base_url+'/avatar/'+user+'/'+size // FIXME routes aren't loaded yet, so OC.Router.generate() doesn't work - $.get(url, function(result) { - if (typeof(result) === 'object') { - $div.placeholder(result.user); - } else { - $div.html('<img src="'+url+'">'); - } + OC.Router.registerLoadedCallback(function() { + var url = OC.Router.generate('core_avatar_get', {user: user, size: size}); + $.get(url, function(result) { + if (typeof(result) === 'object') { + $div.placeholder(result.user); + } else { + $div.html('<img src="'+url+'">'); + } + }); }); }; }(jQuery)); |