PageSourceSearch

https://www.itatbusiness.de/wp-content/themes/highlight-pro/assets/js/woo.js?ver=1.1.91

js itatbusiness.de collected 2026-10-06 17:58:33 UTC 3,675 bytes, 120 lines download raw bytes

1(function ($) {
2
3    var addCloseCartBind = function ($cart, $cart_button, $menu) {
4        $('body').on('mouseover.ope-woo', function (event) {
5            var $target = $(event.target);
6            var related = isHeaderCartRelated($target, $cart, $cart_button) || $target.is($menu);
7            if (!related) {
8                $('body').off('mouseover.ope-woo');
9                $cart.fadeOut();
10            }
11        });
12    };
13
14    jQuery(document).ready(function () {
15        var $menu = jQuery('#main_menu');
16        var $cart_button = $menu.find('li.mesmerize-menu-cart');
17        var $cart = jQuery('.mesmerize-woo-header-cart');
18        positionateWooCartItem($menu, $cart_button, $cart);
19        addCloseCartButton($cart);
20
21        $cart_button.children('a').on('touchstart', function (e) {
22            'use strict';
23            if (!$cart.is(':visible')) {
24                e.preventDefault();
25                showCart($cart, $cart_button, 'absolute');
26            }
27            else {
28                window.location = $(this).attr('href');
29            }
30        });
31
32    });
33
34    $('.woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image:eq(0) .wp-post-image').on('load', function () {
35        var $image = $(this);
36
37        if ($image) {
38            setTimeout(function () {
39                var setHeight = $image.closest('.woocommerce-product-gallery__image').height();
40                var $viewport = $image.closest('.flex-viewport');
41
42                if (setHeight && $viewport) {
43                    $viewport.height(setHeight);
44                }
45            }, 500);
46        }
47    }).each(function () {
48        if (this.complete) {
49            $(this).load();
50        }
51    });
52
53
54    function addCloseCartButton($cart) {
55
56        $cart.prepend('<a href="#" class="close-mini-cart small"><i class="fa fa-close"></i></a>');
57
58        $('.close-mini-cart').click(function () {
59            $('body').off('mouseover.ope-woo');
60            $cart.fadeOut();
61        });
62
63    }
64
65    function positionateWooCartItem($menu, $cart_button, $cart) {
66        $menu.parent().append($cart);
67        var $menuItems = $menu.find('li').not($cart_button);
68
69        $cart_button.children('a').off().on('mouseover', function (event) {
70
71            if ($cart.children().length === 0) {
72                return;
73            }
74
75            $menuItems.trigger('mouseleave');
76
77            addCloseCartBind($cart, $cart_button, $menu);
78            showCart($cart, $cart_button);
79
80        });
81
82    }
83
84    function showCart($cart, $cart_button) {
85
86
87        if ($('body').is('.woocommerce-cart') || $('body').is('.woocommerce-checkout')) {
88            return;
89        }
90
91        var top = $cart_button.offset().top + $cart_button.outerHeight() - $cart_button.closest('div').offset().top;
92        var position = /*$menu.closest('[data-sticky]') ? "fixed" :*/ "absolute";
93
94        if ($cart_button.offset().left < $cart.outerWidth()) {
95            var leftPosition = $cart_button.offset().left + $cart.outerWidth() + 12;
96        }
97        else {
98            var leftPosition = $cart_button.offset().left + $cart_button.width() + 5;
99        }
100
101        $cart.css({
102            'position': position,
103            'z-index': '100000',
104            'top': top,
105            'left': leftPosition,
106        });
107        $cart.fadeIn();
108
109    }
110
111    function isHeaderCartRelated($target, $cart, $cart_button) {
112
113        var isMenuButtoRelated = $.contains($cart_button[0], $target[0]) || $target.is($cart_button);
114        var isCartContentRelated = $.contains($cart[0], $target[0]) || $target.is($cart);
115
116        return (isMenuButtoRelated || isCartContentRelated);
117    }
118
119
120})(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.