From 2acf14ecf00e6603cec0ab3f63578884bec4c740 Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Tue, 14 Sep 2021 20:45:17 +0800 Subject: [PATCH] Replace Disqus lazy loading plugin with native JS --- _includes/disqus.html | 36 +++++++++++++++--------- assets/js/lib/jquery.disqusloader.min.js | 8 ------ 2 files changed, 22 insertions(+), 22 deletions(-) delete mode 100644 assets/js/lib/jquery.disqusloader.min.js diff --git a/_includes/disqus.html b/_includes/disqus.html index 0f32888..e3b83a0 100644 --- a/_includes/disqus.html +++ b/_includes/disqus.html @@ -1,25 +1,33 @@ -
+
a.height()*j||n-b.offset().top-b.outerHeight()-(a.height()*j)>0){return true}e("#disqus_thread").removeAttr("id");b.attr("id","disqus_thread").data("disqusLoaderStatus","loaded");if(f=="loaded"){DISQUS.reset({reload:true,config:i})}else{g.disqus_config=i;if(f=="unloaded"){f="loading";e.ajax({url:c,async:true,cache:true,dataType:"script",success:function(){f="loaded"}})}}};a.on("scroll resize",k(m,l));e.disqusLoader=function(o,n){n=e.extend({},{laziness:1,throttle:250,scriptUrl:false,disqusConfig:false},n);j=n.laziness+1;m=n.throttle;i=n.disqusConfig;c=c===false?n.scriptUrl:c;b=(typeof o=="string"?e(o):o).eq(0);b.data("disqusLoaderStatus","unloaded");l()}})(jQuery,window,document); \ No newline at end of file
Comments powered by Disqus.