PageSourceSearch

https://www.visa.com.ng/etc.clientlibs/rvcom/rvcom-clientlibs/designs/rvcomContainerAccordion.min.js

js visa.com.ng collected 2026-10-02 10:31:05 UTC 5,311 bytes, 120 lines download raw bytes

1$(document).ready(function() {
2    if($("#grspheader").length > 0){
3        $("nav[aria-label='secondary navigation']").removeAttr("style");
4        $("div[data-gtm-card-title='panel'] .panel-action.panel-title").on("click", function(c) {
5            var _this = $(this);
6            _this.toggleClass("collapsed");
7            if (_this.attr("aria-expanded") === "true") {
8                _this.attr("aria-expanded", "false");
9            } else {
10                _this.attr("aria-expanded", "true");
11            }
12            $(_this.attr("data-target")).toggleClass("in");
13        })
14    }
15});
16$(document).ready(function () {
17
18    checkTheTabIDForHashValue();
19
20    $("div[data-gtm-card-title='containerAccordionNew'] dt[data-gtm-card-title='panel'] .vs-accordion-button").bind("click", function (e) {
21        history.replaceState({}, '', window.location.pathname + '#' + $(this).attr("id"));
22    });
23
24    // Check if accordion events are already initialized to prevent duplicates
25    if (!window.accordionEventsInitialized) {
26        initializeAccordionEvents();
27        window.accordionEventsInitialized = true;
28    }
29
30    function initializeAccordionEvents() {
31        // Use a single universal event handler for all accordions
32        $(document).off('click.accordion').on('click.accordion', 'div[data-gtm-card-title="containerAccordionNew"] dt.vs-accordion-item, div[data-gtm-card-title="containerAccordion"] dt.vs-accordion-item', function (e) {
33            handleAccordionClick(e, $(this));
34        });
35    }
36
37    function handleAccordionClick(e, _this) {
38        // Prevent event bubbling and default behavior
39        e.stopPropagation();
40        e.preventDefault();
41
42        // Generate a unique identifier for this specific accordion item
43        var accordionId = _this.attr('id') || _this.find('button').attr('id') || 'accordion-' + Math.random().toString(36).substr(2, 9);
44        var processingFlag = 'accordion-processing-' + accordionId;
45
46        // Check if this specific accordion is already being processed
47        if (_this.data(processingFlag)) {
48            return;
49        }
50
51        // Set processing flag for this specific accordion
52        _this.data(processingFlag, true);
53
54        // Find the immediate accordion container
55        var parentAccordion = _this.closest('div[data-gtm-card-title="containerAccordionNew"], div[data-gtm-card-title="containerAccordion"]');
56        var immediateAccordionParent = _this.parent().closest('div[data-gtm-card-title="containerAccordionNew"], div[data-gtm-card-title="containerAccordion"]');
57
58        // Only proceed if this is a direct child of an accordion container
59        if (parentAccordion.length > 0 && parentAccordion[0] === immediateAccordionParent[0]) {
60            // Execute accordion functionality
61            _this.toggleClass("vs-active");
62            var _button = _this.find(':button');
63            var _accordionContent = _this.next("dd.vs-accordion-item");
64
65            if (_button.attr("aria-expanded") === "true") {
66                _button.attr("aria-expanded", "false");
67                _accordionContent.attr("hidden", "hidden");
68            } else {
69                _button.attr("aria-expanded", "true");
70                _accordionContent.removeAttr("hidden");
71                // START GENAI@CHATGPT4
72                let expEvent = new CustomEvent("container_expanded", {
73                    detail: "container_expanded",
74                });
75                document.dispatchEvent(expEvent);
76                // END GENAI@CHATGPT4
77            }
78            $(_accordionContent).toggleClass("vs-collapsed");
79        }
80
81        // Remove processing flag after a short delay
82        setTimeout(function() {
83            _this.removeData(processingFlag);
84        }, 200);
85    }
86
87    function checkTheTabIDForHashValue() {
88        $("div[data-gtm-card-title='containerAccordionNew'] dt[data-gtm-card-title='panel']  button").each(function (index) {
89            if ($(this).attr("id") === document.location.hash.replace("#", "")) {
90                $('html,body').stop().animate({
91                    scrollTop: $(this).offset().top - 100
92                }, 'linear');
93                setAriaExpanded($(this));
94                return false;
95            }
96        });
97    }
98
99    /**VCOMQI-16585 : code takes care of expanding the panel based on url hash value**/
100    function setAriaExpanded(anchor) {
101        var hrefValue = anchor.attr("id");
102        if (document.location.hash.replace("#", "") === hrefValue) {
103            var accordionItem = anchor.closest(".vs-accordion-item");
104            accordionItem.addClass("vs-active");
105            anchor.attr("aria-expanded", "true");
106            accordionItem.next("dd.vs-accordion-item").removeClass("vs-collapsed");
107            accordionItem.next("dd.vs-accordion-item").removeAttr("hidden");
108        }
109    }
110});
111
112 $(document).on("change", "input[type=checkbox][name='./configureAsFAQ']", function(){
113         var configureAsFAQVal = $(this).is(":checked");
114         var display = configureAsFAQVal ? "block" : "none";
115         $(this).closest(".x-tab-panel-body").find("input[name='./headingTag']").closest(".x-form-item").css("display", display);
116});
117
118triggerconfigureAsFAQChange = function(dialog) {
119   $("input[type=checkbox][name='./configureAsFAQ']").trigger("change");
120}

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.