Skip to content

Commit

Permalink
Merge pull request #9 from mageplaza/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
haitv282 authored Jul 16, 2020
2 parents a528b07 + 3dc9b36 commit 98a5bb2
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 35 deletions.
10 changes: 10 additions & 0 deletions Block/SocialShare.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,16 @@ public function isDisplayInline()
return $type === 'inline';
}

/**
* @return string
*/
public function getPosition()
{
$position = $this->getData('position');

return $position;
}

/**
* @param $displayType
*
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"mageplaza/module-core": "^1.4.5"
},
"type": "magento2-module",
"version": "1.0.1",
"version": "1.0.2",
"license": "proprietary",
"authors": [
{
Expand Down
71 changes: 37 additions & 34 deletions view/frontend/templates/socialshare.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -30,51 +30,56 @@
}

<?php if ($block->isDisplayInline()) :?>
.mp_social_share_inline, .mp_social_share_inline_under_cart {
display: flex;
padding-bottom: 15px;
}

.mp_social_share_inline {
justify-content: flex-end;
}

.mp_social_share_inline_under_cart {
justify-content: flex-start;
}
.mp_social_share_inline, .mp_social_share_inline_under_cart {
display: flex;
border-radius: 7px;
padding: 7px 7px 7px 5px;
<?= /* @noEscape */ $block->getBackgroundColor()?>
}

.mp_social_share_inline {
width: fit-content;
justify-content: flex-end;
<?= $block->getPosition() === 'bottom_content' ? 'float: right;' : 'float: left;' ?>
}

.mp_social_share_inline_under_cart {
justify-content: flex-start;
float: left;
}
<?php else : ?>
.mp_social_share_float {
<?php if ($block->isVerticalStyle($block->getFloatStyle())) : ?>
<?= /* @noEscape */ $block->getFloatMargin('top')?>
<?php endif;?>
<?= /* @noEscape */ $block->getFloatPosition()?>
<?= /* @noEscape */ $block->getBackgroundColor()?>
z-index: 10;
}
.mp_social_share_float {
<?php if ($block->isVerticalStyle($block->getFloatStyle())) : ?>
<?= /* @noEscape */ $block->getFloatMargin('top')?>
<?php endif;?>
<?= /* @noEscape */ $block->getFloatPosition()?>
<?= /* @noEscape */ $block->getBackgroundColor()?>
z-index: 10;
}

<?php if (!$block->isVerticalStyle($block->getFloatStyle())) :?>
.a2a_floating_style.a2a_default_style {
<?= /* @noEscape */ $block->getFloatMargin('bottom')?>
}
.a2a_floating_style.a2a_default_style {
<?= /* @noEscape */ $block->getFloatMargin('bottom')?>
}
<?php endif;?>
@media only screen and (min-width: 430px) {.navigation { z-index: 1; }}
.footer-bottom .container .logo { z-index: 0;}

@media only screen and (min-width: 430px) {.navigation { z-index: 1; }}

.footer-bottom .container .logo { z-index: 0;}
<?php endif;?>
</style>

<div class="<?= /* @noEscape */ $block->getContainerClass($block->getDisplayType()) ?>">
<div class="a2a_kit <?= /* @noEscape */ $block->getDisplayType() ?>
<?= /* @noEscape */ $block->getButtonSize() ?>
<?= /* @noEscape */ $block->getFloatStyle() ?>">

<?php foreach ($block->getEnableService() as $enableService) : ?>
<?php if ($block->isImageEnable($enableService)) : ?>
<a class="a2a_button_<?= /* @noEscape */ $enableService ?>
<?= /* @noEscape */ $block->getShareCounter($enableService) ?>">
<img src="<?= /* @noEscape */ $block->getImageUrl($enableService) ?>"
<?= /* @noEscape */ $block->setImageSize($block->getButtonSize()) ?>
<?= /* @noEscape */ $block->setImageSize($block->getButtonSize()) ?>
alt="<?= /* @noEscape */ $enableService ?>">
</a>
<?php else : ?>
Expand All @@ -89,10 +94,10 @@
<?php endif; ?>
</div>
</div>

<script type="text/javascript">
var a2a_config = a2a_config || {};

a2a_config.icon_color ="<?= /* @noEscape */ $block->getIconColor() ?>";
a2a_config.num_services = <?= /* @noEscape */ $block->getNumberOfService() ?>;
a2a_config.onclick = <?= /* @noEscape */ $block->getMenuType() ?>;
Expand All @@ -101,5 +106,3 @@
</script>
<?php endif; ?>
<?php endif; ?>


0 comments on commit 98a5bb2

Please sign in to comment.