PageSourceSearch

https://homegarden.ro/wp-content/themes/gogreen-child-theme/js/gogreen-child.js?ver=7.1.2

js homegarden.ro collected 2026-09-29 04:13:57 UTC 3,442 bytes, 96 lines download raw bytes

1GoGreen = {
2    init: function () {
3        this.initTabFilterOnInit();
4        setTimeout(function () {
5            GoGreen.scrollToTop();
6        }, 1200);
7
8        // Couldn't find a hook to order portfolio_categories otherwise
9        $('.w-filter a[href="#c-desert"]').closest("li").appendTo($(".w-filter"))
10        this.analyticsEvents();
11
12        if($(".woocommerce-page").length > 0) {
13            this.setProductCategoriesposition();
14        }
15    },
16    initTabFilterOnInit: function () {
17        if (jQuery(".w-filter").length > 0) {
18            var type = window.location.hash.substr(1);
19            setTimeout(function () {
20                $('.w-filter a[href="#' + type + '"]').click();
21            }, 300)
22        }
23    },
24    scrollToTop: function () {
25        $("#toplink-button, #toplink-wrapper a").on("click", function (event) {
26            event.preventDefault();
27            console.log("1")
28            $("html, body").animate({scrollTop: 0}, "slow");
29            return false;
30        });
31    },
32    analyticsEvents: function () {
33        // Define google analytics events for tracking
34        $(".social-icons a").click(function () {
35            var title = $(this).attr('title');
36            switch (title) {
37                case 'Facebook':
38                    ga('send', 'event', {eventCategory: 'Extern', eventAction: 'click', eventLabel: 'Facebook'});
39                    break;
40                case 'Instagram':
41                    ga('send', 'event', {eventCategory: 'Extern', eventAction: 'click', eventLabel: 'Insta'});
42                    break;
43                case 'Youtube':
44                    ga('send', 'event', {eventCategory: 'Extern', eventAction: 'click', eventLabel: 'YouTube'});
45                    break;
46                default:
47                    break
48            }
49        });
50
51        $(".mc4wp-form").submit(function (e) {
52            ga('send', 'event', {eventCategory: 'Contact', eventAction: 'submit', eventLabel: 'contact'});
53        });
54
55        $(".wpcf7-form #form-contact-submit").click(function (e) {
56            ga('send', 'event', {eventCategory: 'Contact', eventAction: 'submit', eventLabel: 'contact'});
57        });
58
59        $(".contact-info .menu-item a").click(function (e) {
60            var href = $(this).attr('href');
61
62            if (href.indexOf('tel') !== -1) {
63                ga('send', 'event', {eventCategory: 'Contact', eventAction: 'click', eventLabel: 'NumarTelefon'});
64            }
65
66            if (href.indexOf('mailto') !== -1) {
67                ga('send', 'event', {eventCategory: 'Contact', eventAction: 'click', eventLabel: 'AdresaMail'});
68            }
69        });
70    },
71    setProductCategoriesposition: function() {
72        // 892 is the tablet/mobile display
73        if ($(window).width() < 892) {
74            GoGreen._changeCategoriesPosition(true);
75        }
76
77        $( window ).resize(function() {
78            if ($( window ).width() < 892) {
79                GoGreen._changeCategoriesPosition(true);
80            } else {
81                GoGreen._changeCategoriesPosition(false);
82            }
83        });
84    },
85    _changeCategoriesPosition: function(set){
86        if(set == true) {
87            $('.widget_product_categories').prependTo($(".w-main.col-9"));
88        } else {
89            $('.widget_product_categories').prependTo($("#right-sidebar .col-inner"));
90        }
91    }
92};
93
94jQuery(document).ready(function () {
95    GoGreen.init();
96});

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.