PageSourceSearch

https://pannylala.com/static/web/js/components.js

js pannylala.com collected 2026-10-02 01:39:26 UTC 3,697 bytes, 127 lines download raw bytes

1/**
2 Core layout handlers and component wrappers
3 **/
4
5// BEGIN: Layout Brand
6var LayoutBrand = function () {
7
8    return {
9        //main function to initiate the module
10        init: function () {
11            $('body').on('click', '.c-hor-nav-toggler', function () {
12                var target = $(this).data('target');
13                $(target).toggleClass("c-shown");
14            });
15        }
16
17    };
18}();
19// END
20
21// BEGIN: Layout Header
22var LayoutHeader = function () {
23    var offset = parseInt($('.c-layout-header').attr('data-minimize-offset') > 0 ? parseInt($('.c-layout-header').attr('data-minimize-offset')) : 0);
24    var _handleHeaderOnScroll = function () {
25        if ($(window).scrollTop() > offset) {
26            //$("body").addClass("c-page-on-scroll");
27        } else {
28            //$("body").removeClass("c-page-on-scroll");
29        }
30    }
31
32    var _handleTopbarCollapse = function () {
33        $('.c-layout-header .c-topbar-toggler').on('click', function (e) {
34            $('.c-layout-header-topbar-collapse').toggleClass("c-topbar-expanded");
35        });
36    }
37
38    return {
39        //main function to initiate the module
40        init: function () {
41            if ($('body').hasClass('c-layout-header-fixed-non-minimized')) {
42                return;
43            }
44
45            _handleHeaderOnScroll();
46            _handleTopbarCollapse();
47
48            $(window).scroll(function () {
49                _handleHeaderOnScroll();
50            });
51        }
52    };
53}();
54// END
55
56// BEGIN: Onepage Nav
57var LayoutOnepageNav = function () {
58
59    var handle = function () {
60        var offset;
61        var scrollspy;
62        var speed;
63        var nav;
64
65        $('body').addClass('c-page-on-scroll');
66        offset = $('.c-layout-header-onepage').outerHeight(true);
67        //$('body').removeClass('c-page-on-scroll');
68
69        if ($('.c-mega-menu-onepage-dots').size() > 0) {
70            if ($('.c-onepage-dots-nav').size() > 0) {
71                $('.c-onepage-dots-nav').css('margin-top', -($('.c-onepage-dots-nav').outerHeight(true) / 2));
72            }
73            scrollspy = $('body').scrollspy({
74                target: '.c-mega-menu-onepage-dots',
75                offset: offset
76            });
77            speed = parseInt($('.c-mega-menu-onepage-dots').attr('data-onepage-animation-speed'));
78        } else {
79            scrollspy = $('body').scrollspy({
80                target: '.c-mega-menu-onepage',
81                offset: offset
82            });
83            speed = parseInt($('.c-mega-menu-onepage').attr('data-onepage-animation-speed'));
84        }
85
86        scrollspy.on('activate.bs.scrollspy', function () {
87            $(this).find('.c-onepage-link.c-active').removeClass('c-active');
88            $(this).find('.c-onepage-link.active').addClass('c-active');
89        });
90
91        $('.c-onepage-link > a').on('click', function (e) {
92            var section = $(this).attr('href');
93            var top = 0;
94
95            if (section !== "#home") {
96                top = $(section).offset().top - offset + 1;
97            }
98
99            $('html, body').stop().animate({
100                scrollTop: top,
101            }, speed, 'easeInExpo');
102
103            e.preventDefault();
104
105            if (App.getViewPort().width < App.getBreakpoint('md')) {
106                $('.c-hor-nav-toggler').click();
107            }
108        });
109    };
110
111    return {
112
113        //main function to initiate the module
114        init: function () {
115            handle(); // call headerFix() when the page was loaded
116        }
117
118    };
119}();
120// END: Onepage Nav
121
122// Main theme initialization
123$(document).ready(function () {
124    // init layout handlers
125    LayoutBrand.init();
126    LayoutOnepageNav.init();
127});

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.