diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2018-03-01 20:12:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-01 20:12:25 +0100 |
commit | effc00c94005a36b0a2e106975f4ec07ba03edb5 (patch) | |
tree | 3333bf2920b4f8792ea2b62660a576834213ec45 /settings/js | |
parent | 0f3ba9444e8b683ba89e100b6a43cab70b3788b9 (diff) | |
parent | d9e936e9f805cd9c474eb0acdf601a129b28201a (diff) | |
download | nextcloud-server-effc00c94005a36b0a2e106975f4ec07ba03edb5.tar.gz nextcloud-server-effc00c94005a36b0a2e106975f4ec07ba03edb5.zip |
Merge pull request #8585 from nextcloud/avatar-loading-disable-fix
Prevent double selection of avatar and loading fix
Diffstat (limited to 'settings/js')
-rw-r--r-- | settings/js/settings/personalInfo.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/settings/js/settings/personalInfo.js b/settings/js/settings/personalInfo.js index 99254c42090..565ae4a2f5b 100644 --- a/settings/js/settings/personalInfo.js +++ b/settings/js/settings/personalInfo.js @@ -311,11 +311,14 @@ $(document).ready(function () { submit: function(e, data) { $('#displayavatar img').hide(); $('#displayavatar .avatardiv').addClass('icon-loading'); + $('#uploadavatar').prop('disabled', true) data.formData = _.extend(data.formData || {}, { requesttoken: OC.requestToken }); }, - fail: function (e, data){ + fail: function (e, data) { + $('#displayavatar .avatardiv').removeClass('icon-loading'); + $('#uploadavatar').prop('disabled', false) var msg = data.jqXHR.statusText + ' (' + data.jqXHR.status + ')'; if (!_.isUndefined(data.jqXHR.responseJSON) && !_.isUndefined(data.jqXHR.responseJSON.data) && @@ -338,7 +341,8 @@ $(document).ready(function () { t('settings', "Select a profile picture"), function (path) { $('#displayavatar img').hide(); - $('#displayavatar .avatardiv').addClass('loading'); + $('#displayavatar .avatardiv').addClass('icon-loading'); + $('#uploadavatar').prop('disabled', true) $.ajax({ type: "POST", url: OC.generateUrl('/avatar/'), @@ -376,8 +380,9 @@ $(document).ready(function () { }); $('#abortcropperbutton').click(function () { - $('#displayavatar .avatardiv').removeClass('loading'); + $('#displayavatar .avatardiv').removeClass('icon-loading'); $('#displayavatar img').show(); + $('#uploadavatar').prop('disabled', false) cleanCropper(); }); |