aboutsummaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2016-09-05 15:08:43 +0200
committerGitHub <noreply@github.com>2016-09-05 15:08:43 +0200
commit06fa48670699a4dc752c2cd44284ef6dc5da9e9f (patch)
treec30a8037c2d0de9d7d41a7ba2177e782eed292d5 /settings
parent12736a359221cf9d6d4dc4c3aba83a545554b02e (diff)
parent6a85882f610ed34c971a1510f5876f0564fd7612 (diff)
downloadnextcloud-server-06fa48670699a4dc752c2cd44284ef6dc5da9e9f.tar.gz
nextcloud-server-06fa48670699a4dc752c2cd44284ef6dc5da9e9f.zip
Merge pull request #1158 from nextcloud/cache_avatars
Cache avatars
Diffstat (limited to 'settings')
-rw-r--r--settings/js/personal.js13
1 files changed, 11 insertions, 2 deletions
diff --git a/settings/js/personal.js b/settings/js/personal.js
index 16a8d184da6..e0c99ae774d 100644
--- a/settings/js/personal.js
+++ b/settings/js/personal.js
@@ -100,6 +100,9 @@ function updateAvatar (hidedefault) {
var $headerdiv = $('#header .avatardiv');
var $displaydiv = $('#displayavatar .avatardiv');
+ //Bump avatar avatarversion
+ oc_userconfig.avatar.version = -(Math.floor(Math.random() * 1000));
+
if (hidedefault) {
$headerdiv.hide();
$('#header .avatardiv').removeClass('avatardiv-shown');
@@ -112,7 +115,10 @@ function updateAvatar (hidedefault) {
$displaydiv.avatar(OC.currentUser, 145, true);
$.get(OC.generateUrl(
'/avatar/{user}/{size}',
- {user: OC.currentUser, size: 1}
+ {
+ user: OC.currentUser,
+ size: 1
+ }
), function (result) {
if (typeof(result) === 'string') {
// Show the delete button when the avatar is custom
@@ -358,7 +364,10 @@ $(document).ready(function () {
// does the user have a custom avatar? if he does show #removeavatar
$.get(OC.generateUrl(
'/avatar/{user}/{size}',
- {user: OC.currentUser, size: 1}
+ {
+ user: OC.currentUser,
+ size: 1
+ }
), function (result) {
if (typeof(result) === 'string') {
// Show the delete button when the avatar is custom