themes/BootstrapChildTheme/SyliusShopBundle/views/Taxon/_verticalMenu.html.twig line 1

Open in your IDE?
  1. {{ sylius_template_event('sylius.shop.product.index.before_vertical_menu', {'taxon': taxon}) }}
  2. {{ sylius_template_event('sylius.shop.product.index.after_vertical_menu', {'taxon': taxon}) }}
  3. {% block javascript %}
  4.     <script>
  5.         $(document).ready(function() {
  6.             $(".sidebar-filter .ui.loadable.form").removeClass("loading");
  7.             $(".sidebar-filter").on("change", "input[type=checkbox]", function() {
  8.                 $(this).closest("form").submit();
  9.             });
  10.             $(".filter-section-header").each(function() {
  11.                 var header = $(this);
  12.                 var content = $("#" + header.attr("aria-controls"));
  13.                 var activeCount = content.find("input[type=checkbox]:checked").length;
  14.                 content.css({ maxHeight: 0, overflow: "hidden" });
  15.                 header.attr("aria-expanded", "false");
  16.                 if (activeCount > 0) {
  17.                     header.find(".filter-section-title").after('<span class="filter-section-count">' + activeCount + '</span>');
  18.                 }
  19.             });
  20.             $(".sidebar-filter").on("click", ".filter-section-header", function(e) {
  21.                 e.preventDefault();
  22.                 var header = $(this);
  23.                 var content = $("#" + header.attr("aria-controls"));
  24.                 var isOpen = header.attr("aria-expanded") === "true";
  25.                 if (isOpen) {
  26.                     content.css("maxHeight", "0");
  27.                     header.attr("aria-expanded", "false");
  28.                     header.removeClass("is-open");
  29.                 } else {
  30.                     content.css("maxHeight", content[0].scrollHeight + "px");
  31.                     header.attr("aria-expanded", "true");
  32.                     header.addClass("is-open");
  33.                 }
  34.             });
  35.         });
  36.     </script>
  37. {% endblock %}