PageSourceSearch

https://nithra.health/wp-content/themes/dentia/elements/widgets/js/grid.js?ver=1.0.0

js nithra.health collected 2026-10-10 01:29:41 UTC 9,009 bytes, 180 lines download raw bytes

1( function( $ ) {
2
3    "use strict";
4    
5    $( window ).on( 'elementor/frontend/init', function() {
6        setTimeout(function() {
7            $('.pxl-grid').each(function(index, element) { 
8                var $grid_scope = $(this);
9                if( $grid_scope.hasClass('pxl-post-list')){
10                    var isoOptions = {};
11                    var $grid_isotope = null;
12                }else{
13                    var $grid_masonry = $grid_scope.find('.pxl-grid-masonry');
14                    var isoOptions = {
15                        itemSelector: '.pxl-grid-item',
16                        layoutMode: $(this).closest('.pxl-grid').attr('data-layout'),
17                        fitRows: {
18                            gutter: 0
19                        },
20                        percentPosition: true,
21                        masonry: {
22                            columnWidth: '.grid-sizer',
23                        },
24                        containerStyle: null,
25                        stagger: 30,
26                        sortBy : 'name',
27                    };
28                    var $grid_isotope = $grid_masonry.isotope(isoOptions);
29                     
30
31                    $grid_scope.on('click', '.pxl-grid-filter .filter-item', function(e) {
32                        
33                        var $this = $(this);
34                        var term_slug = $this.attr('data-filter');  
35                        
36                        $this.siblings('.filter-item.active').removeClass('active');
37                        $this.addClass('active'); 
38                        $grid_scope.find('.pxl-post--inner').removeClass('animated');
39
40                        if( $this.closest('.pxl-grid-filter').hasClass('ajax') ){
41                            var loadmore = $grid_scope.data('loadmore');
42                            loadmore.term_slug = term_slug;
43                            dentia_grid_ajax_handler( $this, $grid_scope, $grid_isotope, 
44                                { action: 'dentia_load_more_post_grid', loadmore: loadmore, iso_options: isoOptions, handler_click: 'filter', scrolltop: 0 }
45                            );
46                        }else{
47                            $grid_isotope.isotope({ filter: term_slug });
48                           
49                        }
50                    });
51                }
52                $grid_scope.on('click', '.pxl-grid-pagination .ajax a.page-numbers', function(e) {
53                    e.preventDefault();
54                    e.stopPropagation();
55                    var $this = $(this);
56                    var loadmore = $grid_scope.data('loadmore');
57                    var paged = $this.attr('href');
58                    paged = paged.replace('#', '');
59                    loadmore.paged = parseInt(paged);
60                    dentia_grid_ajax_handler( $this, $grid_scope, $grid_isotope, 
61                        { action: 'dentia_load_more_post_grid', loadmore: loadmore, iso_options: isoOptions, handler_click: 'pagination', scrolltop: 0, wpnonce: main_params.wpnonce }
62                    );
63                    $('html,body').animate({scrollTop: $grid_scope.offset().top - 130}, 500);
64                });
65
66                $grid_scope.on('click', '.btn-grid-loadmore', function(e) {
67                    e.preventDefault();
68                    var $this = $(this);
69                    var loadmore = $grid_scope.data('loadmore');
70                    loadmore.paged = parseInt($grid_scope.data('start-page')) + 1; 
71
72                    dentia_grid_ajax_handler( $this, $grid_scope, $grid_isotope, 
73                        { action: 'dentia_load_more_post_grid', loadmore: loadmore, iso_options: isoOptions, handler_click: 'loadmore', scrolltop: 0, wpnonce: main_params.wpnonce }
74                    );
75                });
76
77                $grid_scope.on('change', '.orderby', function(e) {
78                    e.preventDefault();
79                    var $this = $(this);
80                    var loadmore = $grid_scope.data('loadmore');
81                    loadmore.orderby = $this.val(); 
82                     
83                    dentia_grid_ajax_handler( $this, $grid_scope, $grid_isotope, 
84                        { action: 'dentia_load_more_post_grid', loadmore: loadmore, iso_options: isoOptions, handler_click: 'select_orderby', scrolltop: 0 }
85                    );
86                });
87
88            });
89
90            function dentia_grid_ajax_handler($this, $grid_scope, $grid_isotope, args = {}){
91                var settings = $.extend( true, {}, {
92                    action: '',
93                    loadmore: '',
94                    iso_options: {},
95                    handler_click: '',
96                    scrolltop: 0
97                }, args );
98               
99                var offset_top = $grid_scope.offset().top; 
100
101                if( settings.handler_click == 'loadmore' ){
102                    var loadmore_text  = $this.closest('.pxl-load-more').data('loadmore-text');
103                    var loading_text  = $this.closest('.pxl-load-more').data('loading-text');
104                    var curoffsettop = $this.offset().top;
105                }
106
107                $.ajax({
108                    url: main_params.ajax_url,
109                    type: 'POST',
110                    data: {
111                        action: settings.action,
112                        settings: settings.loadmore,
113                        handler_click: settings.handler_click
114                    },
115                    success: function( res ) {   
116                        if(res.status == true){  
117                            
118                            if( settings.handler_click == 'loadmore' ){
119                                if( settings.loadmore.wg_type == 'post-list'){
120                                    $grid_scope.find('.pxl-list-inner').append(res.data.html)
121                                }else{
122                                    $grid_scope.find('.pxl-grid-inner').append(res.data.html)
123                                }
124                            }else{
125                                if( settings.loadmore.wg_type == 'post-list'){
126                                    $grid_scope.find('.pxl-list-inner .list-item').remove();
127                                    $grid_scope.find('.pxl-list-inner').append(res.data.html);
128                                }else{
129                                    $grid_scope.find('.pxl-grid-inner .pxl-grid-item').remove();
130                                    $grid_scope.find('.pxl-grid-inner').append(res.data.html);
131                                }
132                            }
133                            if( settings.iso_options && $grid_isotope != null){
134                                $grid_isotope.isotope('destroy');
135                                $grid_isotope.isotope(settings.iso_options);
136                            }
137 
138                          
139                            $grid_scope.data('start-page', res.data.paged);
140     
141                            if( settings.loadmore['pagination_type'] == 'loadmore'){
142                                if(res.data.paged >= res.data.max){
143                                    $grid_scope.find('.pxl-load-more').hide();
144                                }else{
145                                    $grid_scope.find('.pxl-load-more').show();
146                                } 
147                            } 
148                            if( settings.loadmore['pagination_type'] == 'pagination'){
149                                $grid_scope.find(".pxl-grid-pagination").html(res.data.pagin_html);
150                            }
151                            
152                            if( $grid_scope.find('.result-count').length > 0 ){
153                                $grid_scope.find(".result-count").html(res.data.result_count);
154                            } 
155                        }      
156          
157                    },
158                    beforeSend: function() {  
159                        $grid_scope.find('.pxl-grid-overlay-loading').removeClass( 'loaded' ).addClass( 'loader' );
160                        if( settings.handler_click == 'loadmore' ){
161                            $this.find('.pxl-loadmore-text').text(loading_text);
162                            $this.parent().addClass('loading');
163                        }
164                    },
165                    complete: function() {
166                        $grid_scope.find('.pxl-grid-overlay-loading').removeClass( 'loader' ).addClass( 'loaded' ); 
167                        if( settings.handler_click == 'loadmore' ){
168                            $this.find('.pxl-loadmore-text').text(loadmore_text);
169                            $this.parent().removeClass('loading');
170                        }
171                        if ( settings.scrolltop ) {
172                            $( 'html, body' ).animate( { scrollTop: offset_top - 100 }, 0 );
173                        }
174                    }
175                });
176            }
177        }, 150);
178    });
179     
180} )( 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.