Move background image to parent element
This is important for popup form to cover the whole popup [MAILPOET-2880]
This commit is contained in:
@@ -46,6 +46,18 @@ jQuery(($) => {
|
|||||||
return true;
|
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) {
|
function showForm(formDiv, showOverlay = false) {
|
||||||
const form = formDiv.find('form');
|
const form = formDiv.find('form');
|
||||||
const position = form.data('position');
|
const position = form.data('position');
|
||||||
@@ -87,6 +99,9 @@ jQuery(($) => {
|
|||||||
$('.mailpoet_form').each((index, element) => {
|
$('.mailpoet_form').each((index, element) => {
|
||||||
$(element).children('.mailpoet_paragraph').last().addClass('last');
|
$(element).children('.mailpoet_paragraph').last().addClass('last');
|
||||||
});
|
});
|
||||||
|
$('div.mailpoet_form').each((index, element) => {
|
||||||
|
moveStyle($(element));
|
||||||
|
});
|
||||||
$('.mailpoet_form_close_icon').click((event) => {
|
$('.mailpoet_form_close_icon').click((event) => {
|
||||||
const closeIcon = $(event.target);
|
const closeIcon = $(event.target);
|
||||||
const formDiv = closeIcon.parent();
|
const formDiv = closeIcon.parent();
|
||||||
|
Reference in New Issue
Block a user