Hide spacers and limit dividers height in form on mobile

[MAILPOET-3024]
This commit is contained in:
Rostislav Wolny
2020-07-07 13:08:10 +02:00
committed by Veljko V
parent f956c5e13e
commit a6b8330968
3 changed files with 21 additions and 4 deletions

View File

@@ -13,9 +13,16 @@ class Divider {
];
public function render($block): string {
$classes = isset($block['params']['class_name']) ? $block['params']['class_name'] : '';
$classes = ['mailpoet_spacer'];
if (isset($block['params']['type']) && $block['params']['type'] === 'divider') {
$classes[] = 'mailpoet_has_divider';
}
if (!empty($block['params']['class_name'])) {
$classes[] = $block['params']['class_name'];
}
$classAttr = join(' ', $classes);
$height = $block['params']['height'] ?? self::DEFAULT_ATTRIBUTES['height'];
return "<div class='mailpoet_spacer $classes' style='height: {$height}px;'>"
return "<div class='{$classAttr}' style='height: {$height}px;'>"
. $this->renderDivider($block)
. '</div>';
}