laipower/wp-content/upgrade-temp-backup/plugins/gp-premium/blog/functions/js/scripts.min.js

1 line
1.4 KiB
JavaScript
Raw Normal View History

2023-10-22 22:21:44 +00:00
document.addEventListener("DOMContentLoaded",function(){var t,e,n,r,a,i,l=document.querySelector(".masonry-container"),o=(l&&(t=new Masonry(l,generateBlog.masonryInit),e=document.querySelector("#nav-below"),n=document.querySelector(".load-more"),imagesLoaded(l,function(){t.layout(),l.classList.remove("are-images-unloaded"),n&&n.classList.remove("are-images-unloaded"),e&&(e.style.opacity=1)}),e&&l.parentNode.insertBefore(e,l.nextSibling),window.addEventListener("orientationchange",function(){t.layout()})),document.querySelector(".infinite-scroll")),c=document.querySelector(".infinite-scroll-path a");o&&c&&(r=document.querySelectorAll(".infinite-scroll-item")[0].parentNode,a=document.querySelector(".load-more a"),i="",generateBlog.icon&&(i=generateBlog.icon),(o=generateBlog.infiniteScrollInit).outlayer=t,c=new InfiniteScroll(r,o),a&&a.addEventListener("click",function(e){document.activeElement.blur(),e.target.innerHTML=i+generateBlog.loading,e.target.classList.add("loading")}),c.on("append",function(e,n,o){a&&!document.querySelector(".generate-columns-container")&&r.appendChild(a.parentNode),o.forEach(function(e){e=e.querySelectorAll("img");e&&e.forEach(function(e){var n=e.outerHTML;e.outerHTML=n})}),l&&t&&imagesLoaded(l,function(){t.layout()}),a&&(a.innerHTML=i+generateBlog.more,a.classList.remove("loading")),document.body.dispatchEvent(new Event("post-load"))}),c.on("last",function(){var e=document.querySelector(".load-more");e&&(e.style.display="none")}))});