Move properties directly to template

[MAILPOET-3088]
This commit is contained in:
Pavel Dohnal
2020-09-14 09:17:44 +02:00
committed by Veljko V
parent 954e4db742
commit 52953a0b80
2 changed files with 13 additions and 12 deletions

View File

@@ -83,14 +83,6 @@ jQuery(($) => {
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');
formDiv.addClass(`mailpoet_form_position_${position}`);
const animation = form.data('animation');
if (animation !== '') {
formDiv.addClass(`mailpoet_form_animation_${animation}`);
formDiv.prev('.mailpoet_form_popup_overlay').addClass(`mailpoet_form_overlay_animation_${animation}`);
formDiv.prev('.mailpoet_form_popup_overlay').addClass('mailpoet_form_overlay_animation');
}
const background = form.data('background-color'); const background = form.data('background-color');
formDiv.css('background-color', background || 'white'); formDiv.css('background-color', background || 'white');
let delay = form.data('delay'); let delay = form.data('delay');

View File

@@ -7,10 +7,21 @@
<%= before_title | raw %><%= title | raw %><%= after_title | raw %> <%= before_title | raw %><%= title | raw %><%= after_title | raw %>
<% endif %> <% endif %>
<div class="mailpoet_form_popup_overlay"></div> <div class="
mailpoet_form_popup_overlay
<% if(animation != '') %>
mailpoet_form_overlay_animation_<%= animation %>
mailpoet_form_overlay_animation
<% endif %>
"></div>
<div <div
id="<%= form_html_id %>" id="<%= form_html_id %>"
class="mailpoet_form mailpoet_form_<%= form_type %>" class="
mailpoet_form
mailpoet_form_<%= form_type %>
mailpoet_form_position_<%= position %>
mailpoet_form_animation_<%= animation %>
"
<% if(is_preview) %> <% if(is_preview) %>
data-is-preview="1" data-is-preview="1"
data-editor-url="<%= editor_url %>" data-editor-url="<%= editor_url %>"
@@ -33,8 +44,6 @@
class="mailpoet_form mailpoet_form_form mailpoet_form_<%= form_type %>" class="mailpoet_form mailpoet_form_form mailpoet_form_<%= form_type %>"
novalidate novalidate
data-delay="<%= delay %>" data-delay="<%= delay %>"
data-position="<%= position %>"
data-animation="<%= animation %>"
data-exit-intent-enabled="<%= enableExitIntent %>" data-exit-intent-enabled="<%= enableExitIntent %>"
data-background-color="<%= backgroundColor %>" data-background-color="<%= backgroundColor %>"
data-font-family="<%= fontFamily %>" data-font-family="<%= fontFamily %>"