File "blogLoadMore.min.js"
Full Path: /home/ycoalition/public_html/blog/wp-content/themes/woodmart/js/scripts/blog/blogLoadMore.min.js
File size: 1.61 KB
MIME-type: text/plain
Charset: utf-8
!function(u){u.each(["frontend/element_ready/wd_blog.default"],function(o,e){woodmartThemeModule.wdElementorAddAction(e,function(){woodmartThemeModule.blogLoadMore()})}),woodmartThemeModule.blogLoadMore=function(){var s=".wd-blog-load-more.load-on-scroll",m=!1;woodmartThemeModule.clickOnScrollButton(s,!1,!1),u(".wd-blog-load-more").on("click",function(o){o.preventDefault();var t,a,e,d,n,r,l=u(this);m||l.hasClass("no-more-posts")||(m=!0,t=l.parent().siblings(".wd-blog-holder"),o="woodmart_get_blog_"+(a=t.data("source")),e=woodmart_settings.ajaxurl,d="POST",r=t.data("atts"),n=t.data("paged"),l.addClass("loading"),r={atts:r,paged:n,action:o},"main_loop"===a&&(e=l.attr("href"),d="GET",r={}),u.ajax({url:e,data:r,dataType:"json",method:d,success:function(e){woodmartThemeModule.removeDuplicatedStylesFromHTML(e.items,function(o){o=u(o);o&&(t.hasClass("masonry-container")?(t.append(o).isotope("appended",o),t.imagesLoaded().progress(function(){t.isotope("layout"),woodmartThemeModule.clickOnScrollButton(s,!0,!1)})):(t.append(o),t.imagesLoaded().progress(function(){woodmartThemeModule.clickOnScrollButton(s,!0,!1)})),"yes"===woodmart_settings.load_more_button_page_url_opt&&"no"!==woodmart_settings.load_more_button_page_url&&e.currentPage&&window.history.pushState("","",e.currentPage),t.data("paged",n+1),"main_loop"===a&&(l.attr("href",e.nextPage),"no-more-posts"===e.status&&l.hide().remove())),"no-more-posts"===e.status&&(l.addClass("no-more-posts"),l.hide())})},error:function(){console.log("ajax error")},complete:function(){l.removeClass("loading"),m=!1}}))})},u(document).ready(function(){woodmartThemeModule.blogLoadMore()})}(jQuery);