PageSourceSearch

https://www.zpmvcr.cz/themes/zpmv/js/msw_accordion.js?v=0.1

js zpmvcr.cz collected 2026-10-02 15:17:41 UTC 2,013 bytes, 50 lines download raw bytes

1(function ($, Drupal) {
2    Drupal.behaviors.zpmvAccordion = {
3      attach: function (context, settings) {
4        $('.hpFaq25', context).each(function () {
5
6          var accordion = $(this);
7          var faq = accordion.find('.accordion');
8
9          // Wrap each question-answer pair in a new div
10          faq.find('.rollable').each(function() {
11            var rollable = $(this);
12            var question = rollable.find('.cardFaq__title');
13            var answer = rollable.find('.cardFaq__text');
14
15            // Check if this element has already been processed
16            if (!rollable.hasClass('accordion-processed')) {
17              rollable.addClass('accordion-processed');
18
19              rollable.wrapInner('<div class="accordion-item"></div>');
20              question.wrap('<div class="accordion-header"></div>');
21              answer.wrap('<div class="accordion-content"></div>');
22
23              // Initially hide all answers
24              answer.hide();
25
26              // Přidejte tlačítko pro rozbalení/zabalení
27              question.append('<span class="toggle-btn"></span>');
28
29              // Změňte click event na tlačítko místo celé otázky
30              question.find('.toggle-btn').on('click', function(e) {
31                  e.stopPropagation(); // Zabrání propagaci události na rodičovské elementy
32                  var header = $(this).closest('.accordion-header');
33                  var content = header.next('.accordion-content').find('.cardFaq__text');
34
35                  if (content.is(':visible')) {
36                      content.slideUp();
37                      header.removeClass('active');
38                  } else {
39                      faq.find('.cardFaq__text').slideUp();
40                      faq.find('.accordion-header').removeClass('active');
41                      content.slideDown();
42                      header.addClass('active');
43                  }
44              });
45            }
46          });
47        });
48      }
49    };
50  })(jQuery, Drupal);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.