PageSourceSearch

https://pcengine.ru/wp-content/themes/barta/assets/js/main.js?ver=7.1.2

js pcengine.ru collected 2026-10-05 07:04:42 UTC 29,338 bytes, 778 lines download raw bytes

1jQuery(document).ready(function ($) {
2    "use strict";
3
4    var masonaryGrid = null;
5
6    /*tab ajax*/
7    $('.barta-tab-cat ul li').on('click', 'span', function () {
8
9        var _this = $(this),
10            container = _this.parents('.rtin-tab-container'),
11            dataWrapper = _this.parents('.barta-tab-cat'),
12            catID = _this.attr("data-tab-cat"),
13            wtgetData = dataWrapper.data("settings"),
14            template = dataWrapper.data("template"),
15            contentWrap = container.find('.rt-tab-news-holder'),
16            contentWrapHeight = contentWrap.outerHeight(),
17            ul = _this.parents('ul');
18        ul.find('li').removeClass('active');
19        _this.parent().addClass('active');
20
21        $.ajax({
22            url: ThemeObj.ajaxURL,
23            data: {catID: catID, action: 'barta_selected_cat', data: wtgetData, template: template},
24            type: 'POST',
25            beforeSend: function () {
26                contentWrap.find('.loading').fadeIn('slow');
27            },
28            success: function (resp) {
29                contentWrap.animate({
30                    opacity: 0
31                }, 1000, function () {
32                    if (resp.remaining) {
33                        ul.find('.more-link').show();
34                        ul.find('.more-link a').attr('href', resp.cat_link);
35                    } else {
36                        ul.find('.more-link').hide();
37                        ul.find('.more-link a').attr('href', "");
38                    }
39
40                    contentWrap.find('.loading').fadeOut('slow');
41                    contentWrap.html(resp.html);
42                    contentWrap.css({opacity: 1});
43                });
44            },
45            error: function (e) {
46                console.log(e);
47            }
48        });
49
50    });
51	
52
53    var a = $('.offscreen-navigation .menu');
54
55    if (a.length) {
56        a.children("li").addClass("menu-item-parent");
57        a.find(".menu-item-has-children > a").on("click", function (e) {
58            e.preventDefault();
59            $(this).toggleClass("opened");
60            var n = $(this).next(".sub-menu"),
61                s = $(this).closest(".menu-item-parent").find(".sub-menu");
62            a.find(".sub-menu").not(s).slideUp(250).prev('a').removeClass('opened'), n.slideToggle(250)
63        });
64        a.find('.menu-item:not(.menu-item-has-children) > a').on('click', function (e) {
65            $('.rt-slide-nav').slideUp();
66            $('body').removeClass('slidemenuon');
67        });
68    }
69
70    $('.mean-bar .sidebarBtn').on('click', function (e) {
71        e.preventDefault();
72        if ($('.rt-slide-nav').is(":visible")) {
73            $('.rt-slide-nav').slideUp();
74            $('body').removeClass('slidemenuon');
75        } else {
76            $('.rt-slide-nav').slideDown();
77            $('body').addClass('slidemenuon');
78        }
79
80    });	
81
82   $('.br-filter-form').on('submit', function(e){
83		e.preventDefault();
84			
85		var catIDs = [];
86		$.each($("input[name='post_cat']:checked"), function(){
87			catIDs.push($(this).val());
88		});		
89
90		var contentWrap = $('.site-content-wrap');
91		var counter = $('body div.count-post span');
92
93        $.ajax({
94            url: ThemeObj.ajaxURL,
95            data: { catIDs: catIDs, action:'br_cat_selected_cat' },
96            
97			type: 'POST',
98            beforeSend: function () {
99                contentWrap.find('.loading').fadeIn('slow');
100            },
101            success: function (resp) {
102                contentWrap.animate({
103                    opacity: 0
104                }, 1000, function () {
105                    contentWrap.find('.loading').fadeOut('slow');
106                    contentWrap.html(resp.html);
107                    
108					
109                    contentWrap.css({opacity: 1});
110                });
111				counter.html(resp.dd);
112				console.log(resp.dd);				
113            },
114            error: function (e) {
115                console.log(e);
116            }
117        }); 
118		
119    });
120
121	$('.filter-wrapper').on( 'click', '.filter-title span', function(){
122		$('.search-items input.boxes').prop("checked", false); 
123	});
124
125    /*Load More JS*/
126    var loadMoreData = {
127        canBeLoaded: true,
128        bottomOffset: 200,
129        hasMorePost: true,
130        paged: 1,
131    };
132
133    $('.barta_loadmore').click(function () {
134        var data = {
135            action: 'barta_loadmore',
136            paged: loadMoreData.paged,
137            layout_2: $('.blog-layout-2').data("layout"),
138            layout_3: $('.blog-layout-3').data("layout"),
139            layout_4: $('.blog-layout-4-masonry').data("layout"),
140            layout_5: $('.blog-layout-5-masonry').data("layout"),
141
142            /*termId: $('.blog-layout').parents('.blog-layouts').data('termid') || 0,
143            taxonomy: $('.blog-layout').parents('.blog-layouts').data('taxonomy') || null,*/
144
145            termId: $('.blog-layouts').data('termid') || 0,
146            taxonomy: $('.blog-layouts').data('taxonomy') || null,
147
148        }
149        console.log(data);
150
151        if (loadMoreData.canBeLoaded) {
152
153            $.ajax({
154                url: ThemeObj.ajaxURL,
155                data: data,
156                type: 'POST',
157                beforeSend: function (xhr) {
158                    loadMoreData.canBeLoaded = false;
159                    $('.barta_loadmore').text('Loading...');
160                },
161                success: function (data) {
162                    console.log(data);
163                    loadMoreData.paged = data.paged;
164
165                    if (data.html) {
166                        if (masonaryGrid) {
167                            masonaryGrid.append(data.html)
168                                .masonry('appended', data.html)
169                                .masonry('reloadItems')
170                                .masonry();
171                            setTimeout(function () {
172                                masonaryGrid.masonry();
173                            }, 300);
174                        } else {
175                            $(".barta-loadmore").append(data.html);
176                        }
177                    }
178
179                    if (data.more) {
180                        $('.barta_loadmore').text('More posts...');
181                        loadMoreData.canBeLoaded = true;
182                        loadMoreData.hasMorePost = false;
183                    } // TODO Nedd to do for else condition
184                }
185            });
186        }
187    });
188
189    /*Infinity Scroll JS*/
190    var infinityData = {
191        canBeLoaded: true,
192        bottomOffset: 200,
193        hasMorePost: true,
194        paged: 1,
195        scrollWrapper: $('.barta-infinity-scroll') || false
196    };
197
198    if (infinityData.scrollWrapper.length) {
199        $(document).on('scroll load', function () {
200            var data = {
201                    'action': 'barta_infinity_loadmore',
202                    'paged': infinityData.paged,
203                    'layout_2': $('.blog-layout-2').data("layout"),
204                    'layout_3': $('.blog-layout-3').data("layout"),
205                    'layout_4': $('.blog-layout-4-masonry').data("layout"),
206                    'layout_5': $('.blog-layout-5-masonry').data("layout"),
207                    'is_masonry': $('.blog-layout-2.blog-layout-4-masonry').length,
208
209                    termId: $('.blog-layouts').data('termid') || 0,
210                    taxonomy: $('.blog-layouts').data('taxonomy') || null,
211
212                },
213                scrollPoint = $(document).scrollTop(),
214                devHeight = infinityData.scrollWrapper.offset().top + infinityData.scrollWrapper.outerHeight() - 650;
215
216            if (scrollPoint >= devHeight) {
217
218                console.log('Scroll trigger');
219
220                if (infinityData.canBeLoaded) {
221                    console.log(data);
222                    $.ajax({
223                        url: ThemeObj.ajaxURL,
224                        data: data,
225                        type: 'POST',
226                        beforeSend: function (xhr) {
227                            infinityData.canBeLoaded = false;
228                        },
229                        success: function (data) {
230                            infinityData.paged = data.paged;
231                            if (data.html) {
232                                if (masonaryGrid) {
233                                    masonaryGrid.append(data.html)
234                                        .masonry('appended', data.html)
235                                        .masonry('reloadItems')
236                                        .masonry();
237                                } else {
238                                    $(".barta-infinity-scroll").append(data.html);
239                                }
240                            }
241                            if (data.more) {
242                                infinityData.canBeLoaded = true;
243                                infinityData.hasMorePost = false;
244                            } // TODO Need to do for else condition
245                        }
246                    });
247                }
248            }
249        });
250    }
251
252    /* Scroll to top */
253    $('.scrollToTop').on('click', function () {
254        $('html, body').animate({scrollTop: 0}, 800);
255        return false;
256    });
257
258    /* Fixing for hover effect at IOS */
259    $('*').on('touchstart', function () {
260        $(this).trigger('hover');
261    }).on('touchend', function () {
262        $(this).trigger('hover');
263    });
264
265    $(window).scroll(function () {
266        if ($(this).scrollTop() > 100) {
267            $('.scrollToTop').fadeIn();
268            $("body").addClass("not-top");
269            $("body").removeClass("top");
270        } else {
271            $('.scrollToTop').fadeOut();
272            $("body").addClass("top");
273            $("body").removeClass("not-top");
274        }
275    });
276
277    /* Search Box */
278    $(".search-box-area").on('click', '.search-button, .search-close', function (event) {
279        event.preventDefault();
280        if ($('.search-text').hasClass('active')) {
281            $('.search-text, .search-close').removeClass('active');
282        } else {
283            $('.search-text, .search-close').addClass('active');
284        }
285        return false;
286    });
287
288
289    /* Header Right Menu */
290    var menuArea = $('.additional-menu-area');
291    menuArea.on('click', '.side-menu-trigger', function (e) {
292        e.preventDefault();
293        //$('.sidenav').width(380);
294        $('.sidenav').css('transform', 'translateX(0%)');
295        if (!menuArea.find('> .rt-cover').length) {
296            menuArea.append("<div class='rt-cover'></div>");
297        }
298    });
299    menuArea.on('click', '.closebtn', function (e) {
300        e.preventDefault();
301        if (menuArea.find('> .rt-cover').length) {
302            menuArea.find('> .rt-cover').remove();
303        }
304        $('.sidenav').css('transform', 'translateX(100%)');
305    });
306
307    $(document).on('click', '.rt-cover', function () {
308        $(this).remove();
309        $('.sidenav').css('transform', 'translateX(100%)');
310    });
311
312    $(document).on('click', '.print-share-button', function (e) {
313        console.log();
314        e.preventDefault();
315        window.print();
316        return false;
317    });
318
319
320    /* Mega Menu */
321    $('.site-header .main-navigation ul > li.mega-menu').each(function () {
322        // total num of columns
323        var items = $(this).find(' > ul.sub-menu > li').length;
324        // screen width
325        var bodyWidth = $('body').outerWidth();
326        // main menu link width
327        var parentLinkWidth = $(this).find(' > a').outerWidth();
328        // main menu position from left
329        var parentLinkpos = $(this).find(' > a').offset().left;
330
331        var width = items * 220;
332        var left = (width / 2) - (parentLinkWidth / 2);
333
334        var linkleftWidth = parentLinkpos + (parentLinkWidth / 2);
335        var linkRightWidth = bodyWidth - (parentLinkpos + parentLinkWidth);
336
337        // exceeds left screen
338        if ((width / 2) > linkleftWidth) {
339            $(this).find(' > ul.sub-menu').css({
340                width: width + 'px',
341                right: 'inherit',
342                left: '-' + parentLinkpos + 'px'
343            });
344        }
345        // exceeds right screen
346        else if ((width / 2) > linkRightWidth) {
347            $(this).find(' > ul.sub-menu').css({
348                width: width + 'px',
349                left: 'inherit',
350                right: '-' + linkRightWidth + 'px'
351            });
352        } else {
353            $(this).find(' > ul.sub-menu').css({
354                width: width + 'px',
355                left: '-' + left + 'px'
356            });
357        }
358    });
359
360    /* Sticky Menu */
361    if (ThemeObj.stickyMenu == 1 || ThemeObj.stickyMenu == 'on') {
362
363        $(window).on('scroll', function () {
364
365            var s = $('#sticker'),
366                w = $('body'),
367                h = s.outerHeight(),
368                windowpos = $(window).scrollTop(),
369                windowWidth = $(window).width(),
370                h1 = s.parent('#header-1'),
371                h2 = s.parent('#header-2'),
372                h3 = s.parent('#header-3'),
373                h4 = s.parent('#header-4'),
374                h5 = s.parent('#header-5'),
375                h6 = s.parent('#header-6'),
376                h1he = parseInt(s.parent('#header-1').outerHeight()) + 300,
377                h2he = parseInt(s.parent('#header-2').outerHeight()) + 200,
378                h3he = parseInt(s.parent('#header-3').outerHeight()) + 200,
379                h4he = parseInt(s.parent('#header-4').outerHeight()) + 200,
380                h5he = parseInt(s.parent('#header-5').outerHeight()) + 200,
381                h6he = parseInt(s.parent('#header-6').outerHeight()) + 200,
382                h1H = h1.find('.header-top-bar').outerHeight(),
383                topBar = s.prev('.header-top-bar'),
384                topBarP = w.hasClass('has-topbar'),
385                topAdP = $('body .ad-header-top'),
386                tempMenu;
387            if (windowWidth > 991) {
388
389                w.css('padding-top', '');
390                var topBarH, topAdH, totalheight, mBottom, headerFixed = 0;
391                topAdH = topAdP.outerHeight();
392                /*header 1 */
393                if (h1.length || h2.length || h3.length || h4.length || h5.length || h6.length) {
394
395                    // only top bar
396                    if ((topBarP == true) && (topAdH == null)) {
397                        topBarH = topBar.outerHeight() + 210;
398                        headerFixed = $('.masthead-container').outerHeight() + 210;
399                        if (windowpos >= headerFixed) {
400                            if (h1.length || h2.length || h3.length || h4.length || h5.length || h6.length) {
401                                s.addClass('stickp');
402                                w.removeClass("stickh");
403                                w.addClass("non-stickh");
404                            }
405                        } else {
406                            s.removeClass('stickp');
407                            w.removeClass("non-stickh");
408                            w.addClass("stickh");
409                        }
410
411                    } else {
412                        // no topbar now
413                        if (windowpos < parseInt(h1he)) {
414                            s.addClass('stickp');
415                            w.removeClass("non-stickh");
416                            w.addClass("stickh");
417                        } else if (windowpos < parseInt(h2he)) {
418                            s.addClass('stickp');
419                            w.removeClass("non-stickh");
420                            w.addClass("stickh");
421                        } else if (windowpos < parseInt(h3he)) {
422                            s.addClass('stickp');
423                            w.removeClass("non-stickh");
424                            w.addClass("stickh");
425                        } else if (windowpos < parseInt(h4he)) {
426                            s.addClass('stickp');
427                            w.removeClass("non-stickh");
428                            w.addClass("stickh");
429                        } else if (windowpos < parseInt(h5he)) {
430                            s.addClass('stickp');
431                            w.removeClass("non-stickh");
432                            w.addClass("stickh");
433                        } else if (windowpos < parseInt(h6he)) {
434                            s.addClass('stickp');
435                            w.removeClass("non-stickh");
436                            w.addClass("stickh");
437                        } else {
438                            s.removeClass('stickp');
439                            w.removeClass("stickh");
440                            w.addClass("non-stickh");
441                        }
442
443                        var masthead = $('#masthead');
444                        if (masthead.hasClass('header-fixed')) {
445                            h1.css('top', '-' + topBarH + 'px');
446                            h2.css('top', '-' + topBarH + 'px');
447                            h3.css('top', '-' + topBarH + 'px');
448                            h4.css('top', '-' + topBarH + 'px');
449                            h5.css('top', '-' + topBarH + 'px');
450                            h6.css('top', '-' + topBarH + 'px');
451                        }
452                    }
453
454                    // ad and top bar
455                    if ((topBarP == true) && (topAdH != null)) {
456                        headerFixed = topBar.outerHeight();
457
458                        totalheight = headerFixed + topAdH;
459
460                        if (windowpos <= topAdH || windowpos <= headerFixed) {
461                            if (h1.hasClass('header-fixed') || h2.hasClass('header-fixed') || h3.hasClass('header-fixed') || h4.hasClass('header-fixed') || h5.hasClass('header-fixed') || h6.hasClass('header-fixed')) {
462                                h1.css('top', '-' + windowpos + 'px');
463                                h2.css('top', '-' + windowpos + 'px');
464                                h3.css('top', '-' + windowpos + 'px');
465                                h4.css('top', '-' + windowpos + 'px');
466                                h5.css('top', '-' + windowpos + 'px');
467                                h6.css('top', '-' + windowpos + 'px');
468                            }
469                        }
470
471                        if (windowpos >= topAdH || windowpos >= headerFixed) {
472                            if (h1.length || h2.length || h3.length || h4.length || h5.length || h6.length) {
473                                s.addClass('stickp');
474                                w.removeClass("stickh");
475                                w.addClass("non-stickh");
476                            }
477                            if (h1.length || h2.length || h3.length || h4.length || h5.length || h6.length) {
478                                if (h1.hasClass('header-fixed') || h2.hasClass('header-fixed') || h3.hasClass('header-fixed') || h4.hasClass('header-fixed') || h5.hasClass('header-fixed') || h6.hasClass('header-fixed')) {
479                                    h1.css('top', '-' + parseInt(totalheight) + 'px');
480                                    h2.css('top', '-' + parseInt(totalheight) + 'px');
481                                    h3.css('top', '-' + parseInt(totalheight) + 'px');
482                                    h4.css('top', '-' + parseInt(totalheight) + 'px');
483                                    h5.css('top', '-' + parseInt(totalheight) + 'px');
484                                    h6.css('top', '-' + parseInt(totalheight) + 'px');
485                                }
486                            }
487                        } else {
488                            s.removeClass('stickp');
489                            w.removeClass("non-stickh");
490                            w.addClass("stickh");
491                        }
492                    }
493                }
494            }
495
496        });
497    }
498
499    if ($('#primary').find('div.rt-masonry-grid').length !== 0) {
500
501        var $grid = $('.rt-masonry-grid').imagesLoaded(function () {
502            masonaryGrid = $grid.masonry({
503                // set itemSelector so .grid-sizer is not used in layout
504                itemSelector: '.rt-grid-item',
505                percentPosition: true,
506                isAnimated: true,
507                isRTL: true,
508                //originLeft: false,
509                animationOptions: {
510                    duration: 700,
511                    easing: 'linear',
512                    queue: false
513                }
514            });
515            masonaryGrid.masonry('layout');
516        });
517    }
518
519    /*VC JS*/
520    /* Counter */
521    if (typeof $.fn.counterUp == 'function') {
522        $('.rt-vc-counter .rt-counter , .rt-vc-counter-2 .rt-counter , .rt-vc-counter-3 .rt-counter, .rt-vc-counter-4 .rt-counter').counterUp({
523            delay: $(this).data('rtSteps'),
524            time: $(this).data('rtSpeed')
525        });
526    }
527    /* Infobox 1 */
528    $(".rt-info-text-1").on({
529        mouseenter: function () {
530            var hovercolor = $(this).data('hover');
531            $(this).find(".pull-left i").css('color', hovercolor);
532
533            var bghovercolor = $(this).data('bghovercolor');
534            $(this).find(".pull-left i").css('background-color', bghovercolor);
535
536            var title_hover = $(this).data('title-hover');
537            $(this).find(".media-body h3, .media-body h3 a").css('color', title_hover);
538        },
539        mouseleave: function () {
540            var color = $(this).data('color');
541            $(this).find(".pull-left i").css('color', color);
542
543            $(this).find(".pull-left i").css('background-color', '');
544
545            var title_color = $(this).data('title-color');
546            $(this).find(".media-body h3, .media-body h3 a").css('color', title_color);
547        }
548    }, this);
549
550    /* Pricing Box 1 */
551    $(".rt-price-table-box1").on({
552        mouseenter: function () {
553            var bghover = $(this).data('bghover');
554            $(this).css('background-color', bghover);
555            $(this).find(".rt-btn a , .price-holder , a.pricetable-btn").css('color', bghover);
556
557        },
558        mouseleave: function () {
559            var bgcolor = $(this).data('bgcolor');
560            $(this).css('background-color', bgcolor);
561            $(this).find(".rt-btn a").css('color', '');
562            $(this).find(".price-holder").css('color', bgcolor);
563            $(this).find("a.pricetable-btn").css('color', '#f8f8f8');
564        }
565    }, this);
566
567    /* Infobox 5 */
568    $('.rt-infobox-5').each(function () {
569        var $column = $(this).closest('.vc_column-inner');
570        var bgcolor = $column.css('background-color');
571        var bghover = $(this).data('hover');
572        $column.on({
573            mouseenter: function () {
574                $column.attr('style', 'background-color: ' + bghover + ' !important');
575            },
576            mouseleave: function () {
577                $column.attr('style', 'background-color: ' + bgcolor + ' !important');
578            }
579        });
580    });
581
582    /* Woocommerce Shop change view */
583    $('#shop-view-mode li a').on('click', function () {
584        $('body').removeClass('product-grid-view').removeClass('product-list-view');
585
586        if ($(this).closest('li').hasClass('list-view-nav')) {
587            $('body').addClass('product-list-view');
588            Cookies.set('shopview', 'list');
589        } else {
590            $('body').addClass('product-grid-view');
591            Cookies.remove('shopview');
592        }
593        return false;
594    });
595
596    // Popup - Used in video
597    if (typeof $.fn.magnificPopup == 'function') {
598        $('.rt-video-popup').magnificPopup({
599            disableOn: 700,
600            type: 'iframe',
601            mainClass: 'mfp-fade',
602            removalDelay: 160,
603            preloader: false,
604            fixedContentPos: false
605        });
606    }
607
608    if (typeof $.fn.magnificPopup == 'function') {
609        if ($('.zoom-gallery').length) {
610            $('.zoom-gallery').each(function () { // the containers for all your galleries
611                $(this).magnificPopup({
612                    delegate: 'a.ne-zoom', // the selector for gallery item
613                    type: 'image',
614                    gallery: {
615                        enabled: true
616                    }
617                });
618            });
619        }
620    }
621
622    // start the ticker
623    if (typeof $.fn.ticker == 'function') {
624        $('#rt-js-news').ticker({
625            speed: ThemeObj.tickerSpeed,
626            debugMode: true,
627            controls: ThemeObj.tickerControl,
628            titleText: ThemeObj.tickerTitleText,
629            displayType: ThemeObj.tickerStyle,
630            direction: ThemeObj.tickerDirection,
631            pauseOnItems: ThemeObj.tickerDelay,
632
633        });
634    }
635});
636
637//function Load
638function barta_content_load_scripts() {
639    var $ = jQuery;
640    // Preloader
641    $('#preloader').fadeOut('slow', function () {
642        $(this).remove();
643    });
644
645    var windowWidth = $(window).width();
646
647    /* Owl Custom Nav */
648    if (typeof $.fn.owlCarousel == 'function') {
649        $(".owl-custom-nav .owl-next").on('click', function () {
650            $(this).closest('.owl-wrap').find('.owl-carousel').trigger('next.owl.carousel');
651        });
652        $(".owl-custom-nav .owl-prev").on('click', function () {
653            $(this).closest('.owl-wrap').find('.owl-carousel').trigger('prev.owl.carousel');
654        });
655
656        $(".rt-owl-carousel").each(function () {
657            var options = $(this).data('carousel-options');
658            if (ThemeObj.rtl == 'yes') {
659                options['rtl'] = true; //@rtl
660            }
661            $(this).owlCarousel(options);
662        });
663
664
665    }
666
667    /* Slider */
668    if (typeof $.fn.nivoSlider == 'function') {
669        $('.rt-nivoslider , #ensign-nivoslider-3').nivoSlider({
670            effect: 'boxRainReverse',
671            slices: 15,
672            boxCols: 8,
673            boxRows: 4,
674            animSpeed: 500,
675            pauseTime: 6000,
676            startSlide: 0,
677            autoplay: true,
678            directionNav: false,
679            controlNav: true,
680            controlNavThumbs: false,
681            pauseOnHover: false,
682            manualAdvance: false,
683            prevText: '',
684            nextText: '',
685            randomStart: false,
686            beforeChange: function () {
687            },
688            afterChange: function () {
689            },
690            slideshowEnd: function () {
691            },
692            lastSlide: function () {
693            },
694            afterLoad: function () {
695            }
696        });
697        rdtheme_slider_fullscreen();
698    }
699
700    if (typeof $.fn.slick == 'function') {
701        $(".slick-regular").slick();
702    }
703
704}
705
706//function ready
707
708function rdtheme_slider_fullscreen() {
709    $ = jQuery;
710    $('.rt-el-slider').each(function () {
711        var width = $(window).width(),
712            left = $(this).offset().left,
713            $container = $(this).find('.rt-nivoslider');
714        if (width < 1921) {
715            $container.css('margin-left', -left).width(width);
716        } else {
717            leftAlt = left - (width - 1920) / 2;
718            $container.css('margin-left', -leftAlt).width(1920);
719        }
720        $container.css('opacity', 1);
721    });
722}
723
724(function ($) {
725    "use strict";
726
727    // Window Load+Resize
728    $(window).on('load resize', function () {
729
730        // Define the maximum height for mobile menu
731        var wHeight = $(window).height();
732        wHeight = wHeight - 50;
733        $('.mean-nav > ul').css('max-height', wHeight + 'px');
734
735        // Elementor Frontend Load
736        $(window).on('elementor/frontend/init', function () {
737            if (elementorFrontend.isEditMode()) {
738                elementorFrontend.hooks.addAction('frontend/element_ready/widget', function () {
739                    barta_content_load_scripts();
740                });
741            }
742        });
743    });
744
745    // Window Load
746    $(window).on('load', function () {
747        barta_content_load_scripts();
748    });
749
750    $(window).on('scroll', scrollFunction);
751
752    function scrollFunction() {
753        var target = $('#contentHolder');
754		
755		if ( target.length > 0 ) {
756			var contentHeight = target.outerHeight();
757			var documentScrollTop = $(document).scrollTop();
758			var targetScrollTop = target.offset().top;
759			var scrolled = documentScrollTop - targetScrollTop;
760			
761			if (0 <= scrolled) {
762				var scrolledPercentage = (scrolled / contentHeight) * 100;
763				if (scrolledPercentage >= 0 && scrolledPercentage <= 100) {
764					scrolledPercentage = scrolledPercentage >= 90 ? 100 : scrolledPercentage;
765					$("#bartaBar").css({
766						width: scrolledPercentage + "%"
767					});
768				}
769			} else {
770				$("#bartaBar").css({
771					width: "0%"
772				});
773			}
774		}
775    }
776
777})(jQuery);
778

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.