Skip to content

Commit

Permalink
Fixed some minor problems of image carousel
Browse files Browse the repository at this point in the history
  • Loading branch information
sleemy1997 committed Apr 25, 2018
1 parent 5094d00 commit 8f1600e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 19 deletions.
17 changes: 0 additions & 17 deletions assets/less/checkbox.less
Original file line number Diff line number Diff line change
Expand Up @@ -186,21 +186,4 @@
0px 0 0 0 inset;
}
}
@media (max-width: 768px) {
img.carouselImgMobile {
display: block;
}
img.carouselImgDesktop {
display: none;
}
}

@media (min-width: 769px) {
img.carouselImgMobile {
display: none;
}
img.carouselImgDesktop {
display: block;
}
}
}
14 changes: 14 additions & 0 deletions assets/less/helpers.less
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,18 @@

.margin-right-5{
margin-right: 5px;
}

#main-carousel{
.carousel_img_mobile{
display: none;
}
@media (max-width: 767px){
.carousel_img_mobile{
display: block;
}
.carousel_img_desktop{
display: none;
}
}
}
6 changes: 4 additions & 2 deletions widgets/DbCarousel.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use yii\base\InvalidConfigException;
use yii\bootstrap\Carousel;
use yii\helpers\Html;
use centigen\i18ncontent\AssetBundle;

/**
* Class DbCarousel
Expand Down Expand Up @@ -63,7 +64,7 @@ public function init()
$carouselItem = [];
if ($item->getImageUrl() && $item->getImageMobileUrl()) {
$tmpOptionsDesktop = $this->imgOptions;
$class = " carouselImgDesktop";
$class = " carousel_img_desktop";
if (!isset($tmpOptionsDesktop['class'])) {
$tmpOptionsDesktop['class'] = $class;
} else {
Expand All @@ -74,7 +75,7 @@ public function init()


$tmpOptionsMobile = $this->imgOptions;
$class = " carouselImgMobile";
$class = " carousel_img_mobile";
if (!isset($tmpOptionsMobile['class'])) {
$tmpOptionsMobile['class'] = $class;
} else {
Expand Down Expand Up @@ -118,6 +119,7 @@ public function run()
$this->showIndicators = false;
$this->controls = false;
}
AssetBundle::register($this->getView());
return parent::run();
}
}

0 comments on commit 8f1600e

Please sign in to comment.