minor UI fix

This commit is contained in:
Amine Ben hammou
2018-01-09 16:36:01 +00:00
parent c63b7d9b91
commit 5bf532a750
3 changed files with 7 additions and 4 deletions

View File

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

View File

@@ -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',

View File

@@ -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')) {