Advertisement
akozhomka

JS (внутри protected/widgets/filterPanel/views/ajax_filter_panel.php)

Feb 23rd, 2022
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2.     $.ajax('/api/get-filters', {
  3.         method: 'POST',
  4.         data: {
  5.             dokRazdelId: "<?= $dokRazdelId ?>",
  6.             filterRaw: "<?= $filterRaw ?>",
  7.             priceFrom: "<?= $priceFrom ?>",
  8.             priceTo: "<?= $priceTo ?>",
  9.             forAllCars: "<?= $forAllCars ?>",
  10.             <?= '"', DokVitrinaFilter::DOK_VITRINA_FILTER, '"' ?>: "<?= $dokVitrina ?>"
  11.         },
  12.         success: function (data) {
  13.             if (data && data !== null && data !== undefined) {
  14.                 document.querySelector('.catalog__filter-column .filters').html(data);
  15.             }
  16.         },
  17.         beforeSend: function () {
  18.             document.querySelector('.catalog__filter-column .filters')
  19.                 .classList.add('filters-ajax-loader')
  20.                 .prepend('<div class="filter-overlay filter-overlay_show"><div></div></div>')
  21.         },
  22.         complete: function (data) {
  23.             document.querySelector('.catalog__filter-column .filter-overlay.filter-overlay_show').remove();
  24.             document.querySelector('.catalog__filter-column .filters')
  25.                 .removeClass('filters-ajax-loader');
  26.  
  27.             setTimeout(function () {
  28.                 setFilterState(true);
  29.             }, 200)
  30.         }
  31.     });
  32. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement