Skip to content

Commit

Permalink
Clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
alothemes committed Dec 25, 2020
1 parent fb057c0 commit 6d0527e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
3 changes: 1 addition & 2 deletions view/frontend/templates/testimonial-center-mode.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ if(!count($testimonials)) return;
<script type="text/javascript">
require([
'jquery',
'magiccart/slick',
'alothemes',
'magiccart/slick'
], function($){
var el = $('.<?php echo $selector ?> .testimonial');
if(!el.length) return;
Expand Down
15 changes: 2 additions & 13 deletions view/frontend/templates/testimonial.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ $options = $this->getFrontendCfg();
$centerMode = false;
if(isset($options['center-Mode']) && $options['center-Mode']) $centerMode = true;
?>
<div class="<?php /* @escapeNotVerified */ echo $selector ?>">
<div class="testimonial<?php echo $centerMode ? 'center-mode' : '' ?>"
<div class="<?php /* @escapeNotVerified */ echo $selector ?>" data-mage-init='{"gridSlider": {}}' >
<div class="testimonial<?php echo $centerMode ? 'center-mode' : '' ?> grid-slider"
<?php foreach ($options as $opt) :?>
data-<?php /* @escapeNotVerified */ echo $opt ?>='<?php /* @escapeNotVerified */ echo $this->getData($opt) ?>'
<?php endforeach;?>
Expand Down Expand Up @@ -42,14 +42,3 @@ if(isset($options['center-Mode']) && $options['center-Mode']) $centerMode = true
<?php endforeach ?>
</div>
</div>

<script type="text/javascript">
require([
'jquery',
'magiccart/slick',
'alothemes',
], function($, slick, alothemes){
var testimonial = $('.<?php echo $selector ?> .testimonial');
if(testimonial.length) $('head').append(magicproduct(testimonial, '.item'));
});
</script>

0 comments on commit 6d0527e

Please sign in to comment.