Move background image to parent element

This is important for popup form to cover the whole popup

[MAILPOET-2880]
This commit is contained in:
Pavel Dohnal
2020-05-13 13:35:55 +02:00
committed by Veljko V
parent 003fe50403
commit f2078d670e

View File

@@ -46,6 +46,18 @@ jQuery(($) => {
return true;
}
function moveStyle(formDiv) {
const form = formDiv.find('form');
formDiv.css('background-image', form.css('background-image'));
formDiv.css('background-position', form.css('background-position'));
formDiv.css('background-repeat', form.css('background-repeat'));
formDiv.css('background-size', form.css('background-size'));
form.css('background-image', '');
form.css('background-position', '');
form.css('background-repeat', '');
form.css('background-size', '');
}
function showForm(formDiv, showOverlay = false) {
const form = formDiv.find('form');
const position = form.data('position');
@@ -87,6 +99,9 @@ jQuery(($) => {
$('.mailpoet_form').each((index, element) => {
$(element).children('.mailpoet_paragraph').last().addClass('last');
});
$('div.mailpoet_form').each((index, element) => {
moveStyle($(element));
});
$('.mailpoet_form_close_icon').click((event) => {
const closeIcon = $(event.target);
const formDiv = closeIcon.parent();