verification button should be clickable directly after status change, not only after page reload

Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
This commit is contained in:
Bjoern Schiessle 2017-04-27 09:54:38 +02:00 committed by Morris Jobke
parent 072d69ffe4
commit 68ba8572b2
No known key found for this signature in database
GPG key ID: 9CE5ED29E7FCD38A

View file

@ -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');
});
}
});