- Adds new 'fontWeight' property

- Limits max button width to column width
- Adds bold option to buttons
This commit is contained in:
Vlad
2016-02-25 11:32:09 -05:00
parent f9028d28c0
commit 9e81c48bf8
2 changed files with 9 additions and 1 deletions

View File

@@ -1,10 +1,17 @@
<?php
namespace MailPoet\Newsletter\Renderer\Blocks;
use MailPoet\Newsletter\Renderer\Columns\ColumnsHelper;
use MailPoet\Newsletter\Renderer\StylesHelper;
class Button {
static function render($element) {
static function render($element, $column_count) {
$column_width = ColumnsHelper::columnWidth($column_count);
$column_width = $column_width - (StylesHelper::$padding_width * 2);
$element['styles']['block']['width'] =
((int) $element['styles']['block']['width'] > $column_width) ?
$column_width . 'px' :
$element['styles']['block']['width'];
$template = '
<tr>
<td class="mailpoet_padded" valign="top">