PageSourceSearch

https://climbkili.com/wp-content/plugins/elementor-itinerary-widget/assets/script.js?ver=1.0.0

js climbkili.com collected 2026-10-02 07:27:56 UTC 3,948 bytes, 105 lines download raw bytes

1/* ===============================================
2   FILE: assets/script.js
3   =============================================== */
4
5(function($) {
6    'use strict';
7
8    function initItineraryWidget() {
9        $('.month-tab').on('click', function() {
10            const month = $(this).data('month');
11            const $widget = $(this).closest('.itinerary-widget');
12
13            // Update active tab
14            $widget.find('.month-tab').removeClass('active');
15            $(this).addClass('active');
16
17            // Update active content
18            $widget.find('.month-content').removeClass('active');
19            $widget.find('.month-content[data-month="' + month + '"]').addClass('active');
20        });
21
22        // Handle info icon click (for mobile/touch devices)
23        $('.first-day-info-icon').on('click', function(e) {
24            e.preventDefault();
25            e.stopPropagation();
26            const $tooltip = $(this).next('.first-day-info-tooltip');
27            
28            // Toggle active class
29            if ($tooltip.hasClass('active')) {
30                $tooltip.removeClass('active');
31            } else {
32                // Close any other open tooltips first
33                $('.first-day-info-tooltip').removeClass('active');
34                $tooltip.addClass('active');
35            }
36        });
37
38        // Close tooltip when clicking outside
39        $(document).on('click', function(e) {
40            if (!$(e.target).closest('.first-day-info-icon, .first-day-info-tooltip').length) {
41                $('.first-day-info-tooltip').removeClass('active');
42            }
43        });
44
45        // Handle button hover color
46        $('.itinerary-button').hover(function() {
47            const hoverColor = $(this).data('hover-color');
48            if (hoverColor) {
49                $(this).css('background-color', hoverColor);
50            }
51        }, function() {
52            // Reset hover - remove inline style to fall back to CSS
53            $(this).css('background-color', '');
54        });
55
56        // Handle clickable items with nested links
57        $('.itinerary-item.clickable').on('click', function(e) {
58            // Don't trigger if there's an overlay (item is sold out/full)
59            if ($(this).find('.itinerary-overlay').length > 0) {
60                e.preventDefault();
61                return;
62            }
63
64            // Don't trigger if clicking on a button or link inside
65            if ($(e.target).closest('.itinerary-button, .itinerary-title a, .itinerary-included-link').length > 0) {
66                return;
67            }
68
69            // Get the href from the wrapper
70            const href = $(this).attr('href');
71            const target = $(this).attr('target');
72
73            if (href) {
74                if (target === '_blank') {
75                    window.open(href, '_blank');
76                } else {
77                    window.location.href = href;
78                }
79            }
80        });
81
82        // Prevent clicks on nested links and buttons when overlay is present
83        $('.itinerary-item').find('.itinerary-button, .itinerary-title a, .itinerary-included-link').on('click', function(e) {
84            // If parent item has an overlay, prevent all clicks
85            if ($(this).closest('.itinerary-item').find('.itinerary-overlay').length > 0) {
86                e.preventDefault();
87                e.stopPropagation();
88                return false;
89            }
90        });
91    }
92
93    // Initialize on page load
94    $(document).ready(function() {
95        initItineraryWidget();
96    });
97
98    // Re-initialize when Elementor preview updates
99    $(window).on('elementor/frontend/init', function() {
100        elementorFrontend.hooks.addAction('frontend/element_ready/itinerary_widget.default', function($scope) {
101            initItineraryWidget();
102        });
103    });
104
105})(jQuery);

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.