Skip to content

Commit

Permalink
1.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
forrestkirby committed Dec 2, 2021
1 parent 0a13cbc commit a843ef6
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 20 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 1.5.3 (December 02, 2021)

### Fixed

- panel padding update path in flipcard element
- missing classes on cards in flipcard element

## 1.5.2 (December 02, 2021)

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion herzogdupont.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<copyright>Copyright (C) 2021 Thomas Weidlich</copyright>
<license>GNU General Public License version 3, see LICENSE</license>
<creationDate>December 02, 2021</creationDate>
<version>1.5.2</version>
<version>1.5.3</version>
<description>PLG_SYSTEM_HERZOGDUPONT_XML_DESC</description>
<scriptfile>script.php</scriptfile>
<files>
Expand Down
83 changes: 64 additions & 19 deletions modules/elements/elements/hd-flipcard/element.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@
namespace YOOtheme;

return [

'transforms' => [

'render' => function ($node) {

/**
* @var Metadata $metadata
*/
Expand All @@ -19,28 +16,76 @@
$metadata->set('script:builder-hd-flipcard', ['src' => Path::get('./js/hd-flipcard.js'), 'defer' => true]);

// Don't render element if content fields are empty
return (
Str::length($node->props['title'])
|| Str::length($node->props['meta'])
|| Str::length($node->props['content'])
|| $node->props['image']
|| $node->props['icon']
) && (
Str::length($node->props['title_back'])
|| Str::length($node->props['meta_back'])
|| Str::length($node->props['content_back'])
|| $node->props['image_back']
|| $node->props['icon_back']
);

return ( Str::length($node->props['title']) ||
Str::length($node->props['meta']) ||
Str::length($node->props['content']) ||
$node->props['image'] ||
$node->props['icon'] ) && ( Str::length($node->props['title_back']) ||
Str::length($node->props['meta_back']) ||
Str::length($node->props['content_back']) ||
$node->props['image_back'] ||
$node->props['icon_back'] );
},

],

'updates' => [
'2.7.0-beta.0.5' => function ($node) {
if (
isset($node->props['panel_style']) &&
preg_match('/^card-/', $node->props['panel_style'])
) {
if (empty($node->props['panel_card_size'])) {
$node->props['panel_card_size'] = 'default';
}
$node->props['panel_padding'] = $node->props['panel_card_size'];
unset($node->props['panel_card_size']);
}

'2.1.0-beta.0.1' => function ($node) {
if (
isset($node->props['panel_back_style']) &&
preg_match('/^card-/', $node->props['panel_back_style'])
) {
if (empty($node->props['panel_back_card_size'])) {
$node->props['panel_back_card_size'] = 'default';
}
$node->props['panel_back_padding'] = $node->props['panel_back_card_size'];
unset($node->props['panel_back_card_size']);
}
},

'2.7.0-beta.0.1' => function ($node) {
if (isset($node->props['panel_content_padding'])) {
$node->props['panel_padding'] = $node->props['panel_content_padding'];
unset($node->props['panel_content_padding']);
}

if (isset($node->props['panel_size'])) {
$node->props['panel_card_size'] = $node->props['panel_size'];
unset($node->props['panel_size']);
}

if (isset($node->props['panel_card_image'])) {
$node->props['panel_image_no_padding'] = $node->props['panel_card_image'];
unset($node->props['panel_card_image']);
}

if (isset($node->props['panel_back_content_padding'])) {
$node->props['panel_back_padding'] = $node->props['panel_back_content_padding'];
unset($node->props['panel_back_content_padding']);
}

if (isset($node->props['panel_back_size'])) {
$node->props['panel_back_card_size'] = $node->props['panel_back_size'];
unset($node->props['panel_back_size']);
}

if (isset($node->props['panel_back_card_image'])) {
$node->props['panel_back_image_no_padding'] = $node->props['panel_back_card_image'];
unset($node->props['panel_back_card_image']);
}
},

'2.1.0-beta.0.1' => function ($node) {
if (Arr::get($node->props, 'title_grid_width') === 'xxlarge') {
$node->props['title_grid_width'] = '2xlarge';
}
Expand Down
2 changes: 2 additions & 0 deletions modules/elements/elements/hd-flipcard/templates/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
$front = $this->el('div', [

'class' => [
'el-card',
'uk-panel [uk-{panel_style: tile-.*}] {@panel_style: |tile-.*}',
'uk-card uk-{panel_style: card-.*} [uk-card-{!panel_padding: |default}]',
'uk-padding[-{!panel_padding: default}] {@panel_style: |tile-.*} {@panel_padding} {@!has_panel_image_no_padding} {@!has_no_padding}',
Expand Down Expand Up @@ -168,6 +169,7 @@
$back = $this->el($props['link_back'] && $props['panel_back_link'] ? 'a' : 'div', [

'class' => [
'el-card-back',
'uk-panel [uk-{panel_back_style: tile-.*}] {@panel_back_style: |tile-.*}',
'uk-card uk-{panel_back_style: card-.*} [uk-card-{!panel_back_padding: |default}]',
'uk-tile-hover {@panel_back_style: tile-.*} {@panel_back_link} {@link_back}',
Expand Down

0 comments on commit a843ef6

Please sign in to comment.