Replace deprecated event shorthands [MAILPOET-3386]

This commit is contained in:
wxa
2021-02-16 00:33:48 +03:00
committed by Veljko V
parent 9dcceb955d
commit c54f078cd1
24 changed files with 175 additions and 175 deletions

View File

@@ -143,7 +143,7 @@ jQuery(($) => {
Cookies.set('popup_form_dismissed', '1', { expires: 365, path: '/' });
};
$(document).keyup((e) => {
$(document).on('keyup', (e) => {
if (e.key === 'Escape') {
$('div.mailpoet_form').each((index, element) => {
if ($(element).children('.mailpoet_form_close_icon').length !== 0) {
@@ -163,7 +163,7 @@ jQuery(($) => {
renderFontFamily(form.data('font-family'), form.parent());
}
});
$('.mailpoet_form_close_icon').click((event) => {
$('.mailpoet_form_close_icon').on('click', (event) => {
const closeIcon = $(event.target);
const formDiv = closeIcon.parent();
if (formDiv.data('is-preview')) return; // Do not close popup in preview
@@ -185,7 +185,7 @@ jQuery(($) => {
showForm(formDiv, showOverlay);
});
$(window).resize(() => {
$(window).on('resize', () => {
$('.mailpoet_form').each((index, element) => {
// Detect form is placed in tight container
const formDiv = $(element);