minor UI fix
This commit is contained in:
@@ -9,12 +9,12 @@ function ( // eslint-disable-line func-names
|
||||
) {
|
||||
jQuery(function ($) { // eslint-disable-line func-names
|
||||
window.reCaptchaCallback = function () {
|
||||
$('.mailpoet_recaptcha').each(function() {
|
||||
$('.mailpoet_recaptcha').each(function () {
|
||||
var sitekey = $(this).attr('data-sitekey');
|
||||
var container = $(this).find('> .mailpoet_recaptcha_container').get(0);
|
||||
var field = $(this).find('> .mailpoet_recaptcha_field');
|
||||
var widget_id = window.grecaptcha.render(container, {sitekey: sitekey, size: 'compact'});
|
||||
field.val(widget_id);
|
||||
var widgetId = window.grecaptcha.render(container, { sitekey: sitekey, size: 'compact' });
|
||||
field.val(widgetId);
|
||||
});
|
||||
};
|
||||
|
||||
|
@@ -110,7 +110,8 @@ class Widget extends \WP_Widget {
|
||||
true
|
||||
);
|
||||
|
||||
if(!empty(Setting::getValue('re_captcha')) && Setting::getValue('re_captcha.enabled')) {
|
||||
$captcha = Setting::getValue('re_captcha');
|
||||
if(!empty($captcha['enabled'])) {
|
||||
wp_enqueue_script(
|
||||
'mailpoet_recaptcha',
|
||||
'https://www.google.com/recaptcha/api.js?onload=reCaptchaCallback&render=explicit',
|
||||
|
@@ -72,6 +72,8 @@
|
||||
$('#settings_re_captcha_tokens_error').show();
|
||||
window.location.href = '#advanced';
|
||||
return false;
|
||||
} else {
|
||||
$('#settings_re_captcha_tokens_error').hide();
|
||||
}
|
||||
// if we're setting up a sending method, try to activate it
|
||||
if ($('.mailpoet_mta_setup_save').is(':visible')) {
|
||||
|
Reference in New Issue
Block a user