Skip to content

Commit

Permalink
Вертска фильтров
Browse files Browse the repository at this point in the history
  • Loading branch information
skeeks-semenov committed Jun 1, 2023
1 parent 2a9b518 commit fc18757
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/views/filters/eav-filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,14 @@ class="slider-range"

?>

<?= $form->field($handler, $code, [
<?
$classCss = 'js-scrollbar';
if (\Yii::$app->mobileDetect->isMobile) {
$classCss = 'js-scrollbar-native';
} else {
$classCss = 'js-scrollbar';
}
echo $form->field($handler, $code, [
'options' => [
'class' => 'filter--group sx-filter ' . $class,
'tag' => 'section',
Expand All @@ -164,7 +171,7 @@ class="slider-range"
<div>
<div class="filter--group--body">
{$searchOptions}
<div class="js-scrollbar" style="max-height: 280px;">
<div class="{$classCss}">
{input}
</div>
</div>
Expand Down
7 changes: 7 additions & 0 deletions src/widgets/filters/assets/src/css/filters.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@
padding: 0 15px 0 15px;
}


.filter--group .filter--group--body .js-scrollbar,
.filter--group .filter--group--body .js-scrollbar-native {
max-height: 280px;
overflow-x: auto;
}

.filter--group .filter--group--inner {
/*padding: 0 10px 0 10px;*/
}
Expand Down
2 changes: 2 additions & 0 deletions src/widgets/filters/assets/src/js/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@
});
$('body').on("click", ".sx-btn-filter", function () {
$('.sx-filters-block').animate({left: '0'});
$('.sx-filters-block').trigger("show");
return false;
});

$('body').on("click", ".sx-mobile-filters-hide", function () {
$('.sx-filters-block').animate({left: '-100%'});
$('.sx-filters-block').trigger("hide");
return false;
});

Expand Down

0 comments on commit fc18757

Please sign in to comment.