try{var ce=new window.CustomEvent("test");if(ce.preventDefault(),!0!==ce.defaultPrevented)throw new Error("Could not prevent default")}catch(t){var CustomEvent=function(t,e){var n,a;return e=e||{bubbles:!1,cancelable:!1,detail:void 0},(n=document.createEvent("CustomEvent")).initCustomEvent(t,e.bubbles,e.cancelable,e.detail),a=n.preventDefault,n.preventDefault=function(){a.call(this);try{Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})}catch(t){this.defaultPrevented=!0}},n};CustomEvent.prototype=window.Event.prototype,window.CustomEvent=CustomEvent}!function(t){t(document).ready(function(){t(".elm-button").on("click",function(e){e.preventDefault();var n=t(this),a=n.attr("data-href"),o=parseInt(n.attr("data-page"),10)+1,r=parseInt(n.attr("data-max-pages"),10);return n.addClass("is-loading"),a.indexOf("?")>0?a+="&":a+="?",a+="paged="+o,t.ajax({type:"POST",url:a,dataType:"text"}).done(function(e){n.removeClass("is-loading"),t(elm_button_vars.wrapper).length?(t(elm_button_vars.wrapper).append(t(t.parseHTML(e)).find(elm_button_vars.wrapper).addBack(elm_button_vars.wrapper).html()),document.dispatchEvent(new window.CustomEvent("elm-load"))):console.log("Please update Easy Load More settings with post list wrapper selector."),o==r?(n.remove(),document.dispatchEvent(new window.CustomEvent("elm-lastPage"))):n.attr("data-page",o)}).fail(function(){document.dispatchEvent(new window.CustomEvent("elm-fail")),console.log("Ajax failed. Navigating to "+a+"."),document.location.href=a}),!1})})}(jQuery);