PluginProbe ʕ •ᴥ•ʔ
Essential Classy Addons for Elementor – 150+ Widgets, Templates & Performance Tools / 3.0.52
Essential Classy Addons for Elementor – 150+ Widgets, Templates & Performance Tools v3.0.52
4.0 3.0.59 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 3.0 3.0.1 3.0.10 3.0.11 3.0.12 3.0.13 3.0.14 3.0.15 3.0.16 3.0.18 3.0.2 3.0.20 3.0.21 3.0.22 3.0.23 3.0.24 3.0.25 3.0.26 3.0.27 3.0.28 3.0.29 3.0.3 3.0.30 3.0.31 3.0.32 3.0.33 3.0.34 3.0.35 3.0.36 3.0.37 3.0.38 3.0.39 3.0.4 3.0.40 3.0.41 3.0.42 3.0.43 3.0.44 3.0.45 3.0.46 3.0.47 3.0.48 3.0.49 3.0.5 3.0.50 3.0.51 3.0.52 3.0.53 3.0.54 3.0.55 3.0.56 3.0.57 3.0.58 3.0.6 3.0.7 3.0.8 3.0.9
essential-classy-addons-for-elementor / assets / js / custom / ecafe-post-listing.js
essential-classy-addons-for-elementor / assets / js / custom Last commit date
ec-confettieffect.js 6 months ago ec-confettieffect.min.js 6 months ago ecafe-accordion.js 6 months ago ecafe-accordion.min.js 6 months ago ecafe-assets.js 6 months ago ecafe-assets.min.js 6 months ago ecafe-back-to-top.js 6 months ago ecafe-back-to-top.min.js 6 months ago ecafe-changelog.js 6 months ago ecafe-changelog.min.js 6 months ago ecafe-chart.js 6 months ago ecafe-chart.min.js 6 months ago ecafe-countdown.js 6 months ago ecafe-countdown.min.js 6 months ago ecafe-coupon-code.js 6 months ago ecafe-coupon-code.min.js 6 months ago ecafe-hover-background.js 6 months ago ecafe-hover-background.min.js 6 months ago ecafe-image-accordion.js 6 months ago ecafe-image-accordion.min.js 6 months ago ecafe-image-scroll.js 6 months ago ecafe-image-scroll.min.js 6 months ago ecafe-infocircle.js 6 months ago ecafe-infocircle.min.js 6 months ago ecafe-infounfold.js 6 months ago ecafe-infounfold.min.js 6 months ago ecafe-lottie.js 6 months ago ecafe-lottie.min.js 6 months ago ecafe-marketing-link.js 6 months ago ecafe-marketing-link.min.js 6 months ago ecafe-page-piling.js 6 months ago ecafe-page-piling.min.js 6 months ago ecafe-page-scroll-to-id.js 6 months ago ecafe-page-scroll-to-id.min.js 6 months ago ecafe-pdf-viewer.js 6 months ago ecafe-pdf-viewer.min.js 6 months ago ecafe-post-image.js 6 months ago ecafe-post-image.min.js 6 months ago ecafe-post-listing.js 6 months ago ecafe-post-listing.min.js 6 months ago ecafe-qrcode.js 6 months ago ecafe-qrcode.min.js 6 months ago ecafe-scroll-progress.js 6 months ago ecafe-scroll-progress.min.js 6 months ago ecafe-sticky-video.js 6 months ago ecafe-sticky-video.min.js 6 months ago ecafe-tabs.js 6 months ago ecafe-tabs.min.js 6 months ago ecafe-tilt-custom.js 6 months ago ecafe-tilt-custom.min.js 6 months ago ecafe-tippy-custom.js 6 months ago ecafe-tippy-custom.min.js 6 months ago ecafe-toc.js 6 months ago ecafe-toc.min.js 6 months ago ecafe-whatsapp.js 6 months ago ecafe-whatsapp.min.js 6 months ago ecafe.js 6 months ago ecafe.min.js 6 months ago
ecafe-post-listing.js
187 lines
1 /*Load More Post*/
2 ;( function($) {
3 'use strict';
4 $(document).ready(function(){
5 if($(".eca-posts-load-more").length > 0){
6 $(document).on("click", ".posts-load-more", function(e){
7 e.preventDefault();
8 var $this = $(this),
9 settings = $this.data('settings'),
10 postsoffset = settings.postsOffset,
11 numberOfPosts = settings.numberOfPosts,
12 totalPage = settings.totalPage,
13 page = $this.attr("data-page"),
14 loadMorePost = settings.loadMorePost,
15 loadMoreBtnText = settings.loadMoreBtnText,
16 loadingMoreText = settings.loadingMoreText,
17 loadedPostsText = settings.loadedPostsText,
18 ecrtl = settings.ecrtl;
19
20 if(postsoffset === undefined || postsoffset === ""){
21 postsoffset = 0;
22 }
23
24 if(totalPage >= page){
25 var offset = (parseInt(page - 1) * parseInt(loadMorePost)) + parseInt(numberOfPosts) + parseInt(postsoffset);
26 settings.offset = offset;
27 $.ajax({
28 type: 'POST',
29 data: 'settings=' + JSON.stringify(settings) + '&action=eca_load_more_posts',
30 url: ecafe_data.eca_ajax_url,
31 beforeSend: function() {
32 $this.text(loadingMoreText);
33 }, success: function(data) {
34 if(data === ''){
35 $this.addClass("hide");
36 } else {
37 $("." + settings.id + ' .eca-post-listing-inner').append(data);
38 var $newItems = $('');
39 $("." + settings.id + ' .eca-post-listing-inner').isotope('insert', $newItems);
40 $("." + settings.id + ' .eca-post-listing-inner').isotope('layout').isotope('reloadItems');
41 }
42
43 page++;
44 if(page === totalPage){
45 $this.addClass("hide");
46 $this.attr('data-page', page);
47 $this.parent(".eca-posts-load-more").append('<div class="eca-all-posts-loaded">' + loadedPostsText + '</div>');
48 } else {
49 $this.text(loadMoreBtnText);
50 $this.attr('data-page', page);
51 }
52 }, complete: function() {
53 if($("." + settings.id + ' .terms-filters-wrap').length){
54 $("." + settings.id + ' .terms-filters-wrap .terms-filters-lists > li > a').each(function(){
55 var filter = $(this).data("filter");
56 if(filter !== '' && filter !== undefined && filter === '*'){
57 var totle_count = $("." + settings.id + ' .eca-post-listing-inner .ec-grid-wrap').length;
58 } else if(filter !== '' && filter !== undefined){
59 var totle_count = $("." + settings.id + ' .eca-post-listing-inner .ec-grid-wrap' + filter).length;
60 }
61 if(totle_count){
62 $(this).find(".term_count").text(totle_count);
63 }
64 });
65 }
66 $("." + settings.id + ' .eca-post-listing-inner').isotope({
67 itemSelector: '.ec-grid-wrap',
68 originLeft: ecrtl,
69 });
70 }
71 });
72 } else {
73 $this.addClass("hide");
74 }
75 });
76 }
77 });
78
79 $(window).on('load', function(){
80 if($('body').find('.posts-lazy-load').length >= 1){
81 var windowWidth, windowHeight, documentHeight, scrollTop, containerHeight, containerOffset, $window = $(window);
82
83 var load_calc_Values = function() {
84 windowWidth = $window.width();
85 windowHeight = $window.height();
86 documentHeight = $('body').height();
87 containerHeight = $('.eca-isotope').height();
88 containerOffset = $('.eca-isotope').offset().top + 50;
89 setTimeout(function(){
90 containerHeight = $('.eca-isotope').height();
91 containerOffset = $('.eca-isotope').offset().top + 50;
92 }, 50);
93 };
94
95 load_calc_Values();
96 $window.on('resize', load_calc_Values); // Updated from .resize() to .on('resize')
97
98 $window.on('scroll', function(e) { // Updated from .bind() to .on()
99 e.preventDefault();
100 load_calc_Values();
101 scrollTop = $window.scrollTop();
102 $('.eca-isotope').each(function() {
103 var $this = $(this);
104 containerHeight = $this.height();
105 containerOffset = $this.offset().top + 50;
106 if($this.find(".posts-lazy-load").length && scrollTop < documentHeight && scrollTop > (containerHeight + containerOffset - windowHeight)){
107 var load = $this.find(".posts-lazy-load"),
108 settings = load.data('settings'),
109 postsoffset = settings.postsOffset,
110 numberOfPosts = settings.numberOfPosts,
111 totalPage = settings.totalPage,
112 page = load.attr("data-page"),
113 loadMorePost = settings.loadMorePost,
114 loadingMoreText = settings.loadingMoreText,
115 loadedPostsText = settings.loadedPostsText,
116 ecrtl = settings.ecrtl;
117
118 if (load.data('requestRunning')) {
119 return;
120 }
121
122 if(postsoffset === undefined || postsoffset === ""){
123 postsoffset = 0;
124 }
125
126 if(totalPage >= page){
127 load.data('requestRunning', true);
128 var offset = (parseInt(page) - 1) * parseInt(loadMorePost) + parseInt(numberOfPosts) + parseInt(postsoffset);
129 settings.offset = offset;
130 $.ajax({
131 type: 'POST',
132 data: 'settings=' + JSON.stringify(settings) + '&action=eca_load_more_posts',
133 url: ecafe_data.eca_ajax_url,
134 beforeSend: function() {
135 load.find('.lazy-text').text(loadingMoreText);
136 load.addClass('post-loading');
137 }, success: function(data) {
138 if(data === ''){
139 load.addClass("hide");
140 } else {
141 $("." + settings.id + ' .eca-post-listing-inner').append(data);
142 var $newItems = $('');
143 $("." + settings.id + ' .eca-post-listing-inner').isotope('insert', $newItems);
144 $("." + settings.id + ' .eca-post-listing-inner').isotope('layout').isotope('reloadItems');
145 }
146
147 page++;
148 if(page === totalPage){
149 load.addClass("hide");
150 load.attr('data-page', page);
151 load.parent(".eca-posts-lazy-load").append('<div class="eca-all-posts-loaded">' + loadedPostsText + '</div>');
152 } else {
153 load.find('.lazy-text').text('Lazy Load');
154 load.attr('data-page', page);
155 }
156 load.removeClass('post-loading');
157 }, complete: function() {
158 if($("." + settings.id + ' .terms-filters-wrap').length){
159 $("." + settings.id + ' .terms-filters-wrap .terms-filters-lists > li > a').each(function(){
160 var filter = $(this).data("filter");
161 if(filter !== '' && filter !== undefined && filter === '*'){
162 var totle_count = $("." + settings.id + ' .eca-post-listing-inner .ec-grid-wrap').length;
163 } else if(filter !== '' && filter !== undefined){
164 var totle_count = $("." + settings.id + ' .eca-post-listing-inner .ec-grid-wrap' + filter).length;
165 }
166 if(totle_count){
167 $(this).find(".term_count").text(totle_count);
168 }
169 });
170 }
171 load.data('requestRunning', false);
172 $("." + settings.id + ' .eca-post-listing-inner').isotope({
173 itemSelector: '.ec-grid-wrap',
174 originLeft: ecrtl,
175 });
176 }
177 });
178 } else {
179 load.addClass("hide");
180 }
181 }
182 });
183 });
184 }
185 });
186 })(jQuery);
187 /*Load More Post*/