diff --git a/assets/less/checkbox.less b/assets/less/checkbox.less index 23dadd3..6fa86e8 100644 --- a/assets/less/checkbox.less +++ b/assets/less/checkbox.less @@ -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; - } - } } \ No newline at end of file diff --git a/assets/less/helpers.less b/assets/less/helpers.less index cb6c1f4..2eae27a 100644 --- a/assets/less/helpers.less +++ b/assets/less/helpers.less @@ -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; + } + } } \ No newline at end of file diff --git a/widgets/DbCarousel.php b/widgets/DbCarousel.php index 21beb61..1bb7254 100755 --- a/widgets/DbCarousel.php +++ b/widgets/DbCarousel.php @@ -11,6 +11,7 @@ use yii\base\InvalidConfigException; use yii\bootstrap\Carousel; use yii\helpers\Html; +use centigen\i18ncontent\AssetBundle; /** * Class DbCarousel @@ -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 { @@ -74,7 +75,7 @@ public function init() $tmpOptionsMobile = $this->imgOptions; - $class = " carouselImgMobile"; + $class = " carousel_img_mobile"; if (!isset($tmpOptionsMobile['class'])) { $tmpOptionsMobile['class'] = $class; } else { @@ -118,6 +119,7 @@ public function run() $this->showIndicators = false; $this->controls = false; } + AssetBundle::register($this->getView()); return parent::run(); } }