avatar.js 593 B

12345678910111213141516171819
  1. $(document).ready(function(){
  2. if (OC.currentUser) {
  3. var callback = function() {
  4. // do not show display name on mobile when profile picture is present
  5. if($('#header .avatardiv').children().length > 0) {
  6. $('#header .avatardiv').addClass('avatardiv-shown');
  7. }
  8. };
  9. $('#header .avatardiv').avatar(OC.currentUser, 32, undefined, true, callback);
  10. // Personal settings
  11. $('#avatar .avatardiv').avatar(OC.currentUser, 128);
  12. }
  13. // User settings
  14. $.each($('td.avatar .avatardiv'), function(i, element) {
  15. $(element).avatar($(element).parent().parent().data('uid'), 32);
  16. });
  17. });