diff options
author | Robin Appelman <robin@icewind.nl> | 2016-10-20 16:36:03 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2016-10-20 16:36:03 +0200 |
commit | ac167d4dc633f2087326dac7a28281f429d61af8 (patch) | |
tree | b98529313be932e558bfb603381a6074fb3c3c70 /settings/js/personal.js | |
parent | 154fbe06ce643a727f43ca0c980eaa190a4c919a (diff) | |
download | nextcloud-server-ac167d4dc633f2087326dac7a28281f429d61af8.tar.gz nextcloud-server-ac167d4dc633f2087326dac7a28281f429d61af8.zip |
show spinner while loading/cropping avatar
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'settings/js/personal.js')
-rw-r--r-- | settings/js/personal.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/settings/js/personal.js b/settings/js/personal.js index e75f6b9e0f3..c5d659e5c8c 100644 --- a/settings/js/personal.js +++ b/settings/js/personal.js @@ -112,7 +112,10 @@ function updateAvatar (hidedefault) { $('#header .avatardiv').addClass('avatardiv-shown'); } $displaydiv.css({'background-color': ''}); - $displaydiv.avatar(OC.currentUser, 145, true); + $displaydiv.avatar(OC.currentUser, 145, true, null, function() { + $displaydiv.removeClass('loading'); + $('#displayavatar img').show(); + }); $.get(OC.generateUrl( '/avatar/{user}/{size}', { @@ -138,7 +141,6 @@ function showAvatarCropper () { // Looks weird, but on('load', ...) doesn't work in IE8 $cropperImage.ready(function () { - $('#displayavatar').hide(); $cropperImage.Jcrop({ onChange: saveCoords, @@ -295,6 +297,8 @@ $(document).ready(function () { avatarResponseHandler(response); }, submit: function(e, data) { + $('#displayavatar img').hide(); + $('#displayavatar .avatardiv').addClass('loading'); data.formData = _.extend(data.formData || {}, { requesttoken: OC.requestToken }); @@ -321,6 +325,8 @@ $(document).ready(function () { OC.dialogs.filepicker( t('settings', "Select a profile picture"), function (path) { + $('#displayavatar img').hide(); + $('#displayavatar .avatardiv').addClass('loading'); $.ajax({ type: "POST", url: OC.generateUrl('/avatar/'), @@ -358,6 +364,8 @@ $(document).ready(function () { }); $('#abortcropperbutton').click(function () { + $('#displayavatar .avatardiv').removeClass('loading'); + $('#displayavatar img').show(); cleanCropper(); }); |