Maks | fix: починил мобильный фильтр

web_99
Andrei 2 months ago
parent b150193153
commit 2bdfeef5d6
  1. 4
      local/templates/.default/components/bitrix/catalog.smart.filter/cat_filter/style.css
  2. 113
      local/templates/.default/components/bitrix/catalog.smart.filter/cat_filter/template.php

@ -864,7 +864,7 @@ text-decoration:underline;
.bx-filter .bx-filter-popup-result-close { .bx-filter .bx-filter-popup-result-close {
display: none; display: none;
} }
@media (max-width: 767px) { /* @media (max-width: 767px) {
.bx-touch .bx-filter .bx-filter-popup-result { .bx-touch .bx-filter .bx-filter-popup-result {
font-size: 12px; font-size: 12px;
line-height: 14px; line-height: 14px;
@ -887,4 +887,4 @@ text-decoration:underline;
.bx-filter .bx-filter-popup-result .arrow { .bx-filter .bx-filter-popup-result .arrow {
display: none; display: none;
} }
} } */

@ -25,15 +25,50 @@ $templateData = array(
if (isset($templateData['TEMPLATE_THEME'])) { if (isset($templateData['TEMPLATE_THEME'])) {
$this->addExternalCss($templateData['TEMPLATE_THEME']); $this->addExternalCss($templateData['TEMPLATE_THEME']);
} }
// $arResult['FORM_ACTION'] = '/catalog'. preg_replace('~^/catalog/(.+?)filter/~i', "/", $arResult['FORM_ACTION']);
//$this->addExternalCss("/bitrix/css/main/bootstrap.css");
//$this->addExternalCss("/bitrix/css/main/font-awesome.css");
?> ?>
<aside class="catalog-page__filter">
<div class="catalog-page__filter-wrap"> <? // Start | Правки мобильной версии фильтра ?>
<div class="bx-filter <?= $templateData["TEMPLATE_CLASS"] ?> <? if ($arParams["FILTER_VIEW_MODE"] == "HORIZONTAL") echo "bx-filter-horizontal" ?>"> <style>
@media (max-width:540px) {
.catalog-page__filter .filter {
min-height: 100vh;
}
.bx-touch .bx-filter .bx-filter-popup-result{
font-size: 13px;
font-weight: normal;
position: absolute;
z-index: 915;
display: none;
line-height: normal;
margin-top: -7px;
margin-left: 10px;
padding: 0 10px;
white-space: nowrap;
color: #3f3f3f;
min-height: 37px;
line-height: 18px;
background-color: #ff7f23;
color: white;
padding: 6px 10px;
border-radius: 8px;
right: 0;
}
.bx-filter .bx-filter-popup-result::after{
left: -9px;
border-right: 10px solid #ff7f23;
border-left: unset;
right: unset;
}
}
</style>
<? // End | Правки мобильной версии фильтра ?>
<div class="bx-filter <?= $templateData["TEMPLATE_CLASS"] ?> <? if ($arParams["FILTER_VIEW_MODE"] == "HORIZONTAL") echo "bx-filter-horizontal" ?>">
<form name="<? echo $arResult["FILTER_NAME"] . "_form" ?>" action="<? echo $arResult["FORM_ACTION"] ?>" <form name="<? echo $arResult["FILTER_NAME"] . "_form" ?>" action="<? echo $arResult["FORM_ACTION"] ?>"
method="get"> method="get">
<div class="filter"> <div class="filter">
@ -49,58 +84,6 @@ if (isset($templateData['TEMPLATE_THEME'])) {
</button> </button>
</div> </div>
<div class="filter__wrap filter__wrap--left"> <div class="filter__wrap filter__wrap--left">
<!-- <div class="filter__item filter__item--list">-->
<!-- <a class="filter__category is-active filter__category--base" href="category.html">-->
<!-- Все товары <span>48</span>-->
<!-- </a>-->
<!-- <a class="filter__category" href="category.html">-->
<!-- Септики<span>30</span>-->
<!-- </a>-->
<!-- <a class="filter__category" href="category.html">-->
<!-- Канализации<span>4</span>-->
<!-- </a>-->
<!-- <a class="filter__category" href="category.html">-->
<!-- Станции очистки<span>4</span>-->
<!-- </a>-->
<!-- <a class="filter__category" href="category.html">-->
<!-- ЛОС<span>10</span>-->
<!-- </a>-->
<!-- </div>-->
<!-- --><?//$APPLICATION->IncludeComponent(
// "bitrix:catalog.section.list",
// ".default",
// array(
// "ADDITIONAL_COUNT_ELEMENTS_FILTER" => "additionalCountFilter",
// "ADD_SECTIONS_CHAIN" => "Y",
// "CACHE_FILTER" => "N",
// "CACHE_GROUPS" => "Y",
// "CACHE_TIME" => "36000000",
// "CACHE_TYPE" => "A",
// "COUNT_ELEMENTS" => "Y",
// "COUNT_ELEMENTS_FILTER" => "CNT_ACTIVE",
// "FILTER_NAME" => "",
// "HIDE_SECTIONS_WITH_ZERO_COUNT_ELEMENTS" => "N",
// "IBLOCK_ID" => "4",
// "IBLOCK_TYPE" => "catalog",
// "SECTION_CODE" => "",
// "SECTION_FIELDS" => array(
// 0 => "",
// 1 => "",
// ),
// "SECTION_ID" => $_REQUEST["SECTION_ID"],
// "SECTION_URL" => "#SECTION_CODE_PATH#",
// "SECTION_USER_FIELDS" => array(
// 0 => "",
// 1 => "",
// ),
// "SHOW_PARENT_NAME" => "Y",
// "TOP_DEPTH" => "1",
// "VIEW_MODE" => "LIST",
// "COMPONENT_TEMPLATE" => ".default"
// ),
// false
// );?>
<?$APPLICATION->IncludeComponent("bitrix:menu", "catalog_left_menu", Array( <?$APPLICATION->IncludeComponent("bitrix:menu", "catalog_left_menu", Array(
"ALLOW_MULTI_SELECT" => "N", // Разрешить несколько активных пунктов одновременно "ALLOW_MULTI_SELECT" => "N", // Разрешить несколько активных пунктов одновременно
"CHILD_MENU_TYPE" => "catalog_links", // Тип меню для остальных уровней "CHILD_MENU_TYPE" => "catalog_links", // Тип меню для остальных уровней
@ -116,7 +99,7 @@ if (isset($templateData['TEMPLATE_THEME'])) {
"MENU_THEME" => "site", // Тема меню "MENU_THEME" => "site", // Тема меню
), ),
false false
);?> );?>
<? foreach ($arResult["HIDDEN"] as $arItem): ?> <? foreach ($arResult["HIDDEN"] as $arItem): ?>
<input type="hidden" name="<? echo $arItem["CONTROL_NAME"] ?>" <input type="hidden" name="<? echo $arItem["CONTROL_NAME"] ?>"
@ -950,14 +933,8 @@ if (isset($templateData['TEMPLATE_THEME'])) {
</div> </div>
</form> </form>
</div> </div>
</div>
</aside>
<?php
// array_walk_recursive($arResult, static function (&$item, $key) {
// $item = '/'. ltrim(str_replace(['/catalog', '/filter'], '', $item), '/');
// });
?>
<script> <script>
var smartFilter = new JCSmartFilter( var smartFilter = new JCSmartFilter(
'<?= CUtil::JSEscape($arResult["FORM_ACTION"]) ?>', '<?= CUtil::JSEscape($arResult["FORM_ACTION"]) ?>',

Loading…
Cancel
Save