Copy form colour to the popup background

[MAILPOET-2741]
This commit is contained in:
Pavel Dohnal
2020-03-25 12:28:49 +01:00
committed by Veljko V
parent 9d4bb40975
commit 149bb90245
3 changed files with 7 additions and 1 deletions

View File

@@ -37,7 +37,10 @@ jQuery(($) => {
$(() => {
$('div.mailpoet_form_popup').each((index, element) => {
const formDiv = $(element);
let delay = formDiv.find('form').data('delay');
const form = formDiv.find('form');
const background = form.data('background-color');
formDiv.css('background-color', background || 'white');
let delay = form.data('delay');
delay = parseInt(delay, 10);
if (Number.isNaN(delay)) {
delay = 0;
@@ -46,6 +49,7 @@ jQuery(($) => {
formDiv.addClass('active');
}, delay * 1000);
});
// setup form validation
$('form.mailpoet_form').each((index, element) => {
const form = $(element);