From 68ba8572b2d044f5af38a25a38f9217039a4ccb1 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Thu, 27 Apr 2017 09:54:38 +0200 Subject: [PATCH] verification button should be clickable directly after status change, not only after page reload Signed-off-by: Bjoern Schiessle --- settings/js/personal.js | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/settings/js/personal.js b/settings/js/personal.js index d60f08c47b..3249382a88 100644 --- a/settings/js/personal.js +++ b/settings/js/personal.js @@ -208,20 +208,27 @@ $(document).ready(function () { dialog.css('display', 'block'); }; - $(".verify-action").click(function () { - var account = $(this); - var accountId = $(this).attr('id'); - $.ajax( - OC.generateUrl('/settings/users/{account}/verify', {account: accountId}), - {method: 'GET'} - ).done(function(data) { - var dialog = account.closest('.verify').children('.verification-dialog'); - showVerifyDialog(dialog, data.msg, data.code); - account.attr('title', t('core', 'Verifying …')); - account.attr('src', OC.imagePath('core', 'actions/verifying.svg')); - account.removeClass('verify-action'); + $(".verify").click(function (event) { - }); + event.stopPropagation(); + + var verify = $(this); + var indicator = $(this).children('img'); + var accountId = indicator.attr('id'); + + if (indicator.hasClass('verify-action')) { + $.ajax( + OC.generateUrl('/settings/users/{account}/verify', {account: accountId}), + {method: 'GET'} + ).done(function (data) { + var dialog = verify.children('.verification-dialog'); + showVerifyDialog($(dialog), data.msg, data.code); + indicator.attr('title', t('core', 'Verifying …')); + indicator.attr('src', OC.imagePath('core', 'actions/verifying.svg')); + indicator.removeClass('verify-action'); + + }); + } });