Hide background on mobile
[MAILPOET-2880]
This commit is contained in:
@@ -48,6 +48,7 @@ jQuery(($) => {
|
||||
|
||||
function moveStyle(formDiv) {
|
||||
const form = formDiv.find('form');
|
||||
formDiv.data('background-image', form.css('background-image'));
|
||||
formDiv.css('background-image', form.css('background-image'));
|
||||
formDiv.css('background-position', form.css('background-position'));
|
||||
formDiv.css('background-repeat', form.css('background-repeat'));
|
||||
@@ -58,6 +59,14 @@ jQuery(($) => {
|
||||
form.css('background-size', '');
|
||||
}
|
||||
|
||||
function checkFormBackground(formDiv) {
|
||||
if ($(window).width() >= 500) {
|
||||
formDiv.css('background-image', formDiv.data('background-image'));
|
||||
} else {
|
||||
formDiv.css('background-image', '');
|
||||
}
|
||||
}
|
||||
|
||||
function showForm(formDiv, showOverlay = false) {
|
||||
const form = formDiv.find('form');
|
||||
const position = form.data('position');
|
||||
@@ -129,6 +138,7 @@ jQuery(($) => {
|
||||
// Detect form is placed in tight container
|
||||
const formDiv = $(element);
|
||||
checkFormContainer(formDiv.find('form'));
|
||||
checkFormBackground(formDiv);
|
||||
});
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user