Add small container detection on desktop

[MAILPOET-2609]
This commit is contained in:
Rostislav Wolny
2020-02-19 14:53:01 +01:00
committed by Pavel Dohnal
parent e5f84f9333
commit 0c64c38e61
3 changed files with 31 additions and 12 deletions

View File

@@ -41,7 +41,10 @@ jQuery(function ($) { // eslint-disable-line func-names
// setup form validation
$('form.mailpoet_form').each(function () { // eslint-disable-line func-names
var form = $(this);
// Detect form is placed in tight container
if (form.width() < 500) {
form.addClass('mailpoet_form_tight_container');
}
form.parsley().on('form:validated', function () { // eslint-disable-line func-names
// clear messages
form.find('.mailpoet_message > p').hide();