From b927cf62ed52edd98dba8297d9242a0cd108ccfd Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 11 Mar 2021 18:32:57 +0000 Subject: [PATCH] Adjust infinite scroll selector to target article.post-card (#763) The tag archive header shares the same classes as post cards, but have different elements. This changes the selector to target article.post-card, which ignores header.post-card --- assets/built/casper.js | 2 +- assets/built/casper.js.map | 2 +- assets/js/infinite-scroll.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/built/casper.js b/assets/built/casper.js index e3654d3..1f15f7f 100644 --- a/assets/built/casper.js +++ b/assets/built/casper.js @@ -1,2 +1,2 @@ -!function(o){"use strict";o.fn.fitVids=function(e){var t,i,n={customSelector:null,ignore:null};return document.getElementById("fit-vids-style")||(t=document.head||document.getElementsByTagName("head")[0],(i=document.createElement("div")).innerHTML='

x

',t.appendChild(i.childNodes[1])),e&&o.extend(n,e),this.each(function(){var e=['iframe[src*="player.vimeo.com"]','iframe[src*="youtube.com"]','iframe[src*="youtube-nocookie.com"]','iframe[src*="kickstarter.com"][src*="video.html"]',"object","embed"];n.customSelector&&e.push(n.customSelector);var r=".fitvidsignore";n.ignore&&(r=r+", "+n.ignore);e=o(this).find(e.join(","));(e=(e=e.not("object object")).not(r)).each(function(){var e,t,i=o(this);0
').parent(".fluid-width-video-wrapper").css("padding-top",100*e+"%"),i.removeAttr("height").removeAttr("width"))})})},o.fn.fitVids._count=0}(window.jQuery||window.Zepto),function(e){e.addEventListener("DOMContentLoaded",function(){e.querySelectorAll(".kg-gallery-image img").forEach(function(e){var t=e.closest(".kg-gallery-image"),e=e.attributes.width.value/e.attributes.height.value;t.style.flex=e+" 1 0%"})})}((window,document)),function(t,i){var r,n,o,d,s,a,l,c=i.querySelector("link[rel=next]");function h(){if(404===this.status)return t.removeEventListener("scroll",f),void t.removeEventListener("resize",m);this.response.querySelectorAll(".post-card").forEach(function(e){r.appendChild(i.importNode(e,!0))});var e=this.response.querySelector("link[rel=next]");e?c.href=e.href:(t.removeEventListener("scroll",f),t.removeEventListener("resize",m)),l=i.documentElement.scrollHeight,d=o=!1}function e(){var e;d||(s+a<=l-n?o=!1:(d=!0,(e=new t.XMLHttpRequest).responseType="document",e.addEventListener("load",h),e.open("GET",c.href),e.send(null)))}function u(){o||t.requestAnimationFrame(e),o=!0}function f(){s=t.scrollY,u()}function m(){a=t.innerHeight,l=i.documentElement.scrollHeight,u()}!c||(r=i.querySelector(".post-feed"))&&(d=o=!(n=300),s=t.scrollY,a=t.innerHeight,l=i.documentElement.scrollHeight,t.addEventListener("scroll",f,{passive:!0}),t.addEventListener("resize",m),u())}(window,document); +!function(o){"use strict";o.fn.fitVids=function(e){var t,i,n={customSelector:null,ignore:null};return document.getElementById("fit-vids-style")||(t=document.head||document.getElementsByTagName("head")[0],(i=document.createElement("div")).innerHTML='

x

',t.appendChild(i.childNodes[1])),e&&o.extend(n,e),this.each(function(){var e=['iframe[src*="player.vimeo.com"]','iframe[src*="youtube.com"]','iframe[src*="youtube-nocookie.com"]','iframe[src*="kickstarter.com"][src*="video.html"]',"object","embed"];n.customSelector&&e.push(n.customSelector);var r=".fitvidsignore";n.ignore&&(r=r+", "+n.ignore);e=o(this).find(e.join(","));(e=(e=e.not("object object")).not(r)).each(function(){var e,t,i=o(this);0
').parent(".fluid-width-video-wrapper").css("padding-top",100*e+"%"),i.removeAttr("height").removeAttr("width"))})})},o.fn.fitVids._count=0}(window.jQuery||window.Zepto),function(e){e.addEventListener("DOMContentLoaded",function(){e.querySelectorAll(".kg-gallery-image img").forEach(function(e){var t=e.closest(".kg-gallery-image"),e=e.attributes.width.value/e.attributes.height.value;t.style.flex=e+" 1 0%"})})}((window,document)),function(t,i){var r,n,o,d,s,a,l,c=i.querySelector("link[rel=next]");function h(){if(404===this.status)return t.removeEventListener("scroll",f),void t.removeEventListener("resize",m);this.response.querySelectorAll("article.post-card").forEach(function(e){r.appendChild(i.importNode(e,!0))});var e=this.response.querySelector("link[rel=next]");e?c.href=e.href:(t.removeEventListener("scroll",f),t.removeEventListener("resize",m)),l=i.documentElement.scrollHeight,d=o=!1}function e(){var e;d||(s+a<=l-n?o=!1:(d=!0,(e=new t.XMLHttpRequest).responseType="document",e.addEventListener("load",h),e.open("GET",c.href),e.send(null)))}function u(){o||t.requestAnimationFrame(e),o=!0}function f(){s=t.scrollY,u()}function m(){a=t.innerHeight,l=i.documentElement.scrollHeight,u()}!c||(r=i.querySelector(".post-feed"))&&(d=o=!(n=300),s=t.scrollY,a=t.innerHeight,l=i.documentElement.scrollHeight,t.addEventListener("scroll",f,{passive:!0}),t.addEventListener("resize",m),u())}(window,document); //# sourceMappingURL=casper.js.map \ No newline at end of file diff --git a/assets/built/casper.js.map b/assets/built/casper.js.map index 9ed77c2..a1015fe 100644 --- a/assets/built/casper.js.map +++ b/assets/built/casper.js.map @@ -1 +1 @@ -{"version":3,"sources":["jquery.fitvids.js","gallery-card.js","infinite-scroll.js"],"names":["$","fn","fitVids","options","head","div","settings","customSelector","ignore","document","getElementById","getElementsByTagName","createElement","innerHTML","appendChild","childNodes","extend","this","each","selectors","push","ignoreList","$allVideos","find","join","not","aspectRatio","videoName","$this","parents","length","tagName","toLowerCase","parent","css","isNaN","attr","parseInt","height","width","_count","wrap","removeAttr","window","jQuery","Zepto","addEventListener","querySelectorAll","forEach","image","container","closest","ratio","attributes","value","style","flex","feedElement","buffer","ticking","loading","lastScrollY","lastWindowHeight","lastDocumentHeight","nextElement","querySelector","onPageLoad","status","removeEventListener","onScroll","onResize","response","item","importNode","resNextElement","href","documentElement","scrollHeight","onUpdate","xhr","XMLHttpRequest","responseType","open","send","requestTick","requestAnimationFrame","scrollY","innerHeight","passive"],"mappings":"CAYA,SAAAA,gBAIAA,EAAAC,GAAAC,QAAA,SAAAC,GACA,IAOAC,EAEAC,EATAC,EAAA,CACAC,eAAA,KACAC,OAAA,MAgBA,OAbAC,SAAAC,eAAA,oBAEAN,EAAAK,SAAAL,MAAAK,SAAAE,qBAAA,QAAA,IAEAN,EAAAI,SAAAG,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G,EAAAlB,EAAA2C,QACAxB,EAAAnB,EAAA4C,YACAxB,EAAAtD,EAAAmE,gBAAAC,aAwEAlC,EAAAG,iBAAA,SAAAuB,EAAA,CAAAmB,SAAA,IACA7C,EAAAG,iBAAA,SAAAwB,GAEAc,KA/FA,CAgGAzC,OAAAlC","file":"casper.js","sourcesContent":["/*jshint browser:true */\n/*!\n* FitVids 1.3\n*\n*\n* Copyright 2017, Chris Coyier + Dave Rupert + Ghost Foundation\n* This is an unofficial release, ported by John O'Nolan\n* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/\n* Released under the MIT license\n*\n*/\n\n;(function( $ ){\n\n 'use strict';\n\n $.fn.fitVids = function( options ) {\n var settings = {\n customSelector: null,\n ignore: null\n };\n\n if(!document.getElementById('fit-vids-style')) {\n // appendStyles: https://github.com/toddmotto/fluidvids/blob/master/dist/fluidvids.js\n var head = document.head || document.getElementsByTagName('head')[0];\n var css = '.fluid-width-video-container{flex-grow: 1;width:100%;}.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}';\n var div = document.createElement(\"div\");\n div.innerHTML = '

x

';\n head.appendChild(div.childNodes[1]);\n }\n\n if ( options ) {\n $.extend( settings, options );\n }\n\n return this.each(function(){\n var selectors = [\n 'iframe[src*=\"player.vimeo.com\"]',\n 'iframe[src*=\"youtube.com\"]',\n 'iframe[src*=\"youtube-nocookie.com\"]',\n 'iframe[src*=\"kickstarter.com\"][src*=\"video.html\"]',\n 'object',\n 'embed'\n ];\n\n if (settings.customSelector) {\n selectors.push(settings.customSelector);\n }\n\n var ignoreList = '.fitvidsignore';\n\n if(settings.ignore) {\n ignoreList = ignoreList + ', ' + settings.ignore;\n }\n\n var $allVideos = $(this).find(selectors.join(','));\n $allVideos = $allVideos.not('object object'); // SwfObj conflict patch\n $allVideos = $allVideos.not(ignoreList); // Disable FitVids on this video.\n\n $allVideos.each(function(){\n var $this = $(this);\n if($this.parents(ignoreList).length > 0) {\n return; // Disable FitVids on this video.\n }\n if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; }\n if ((!$this.css('height') && !$this.css('width')) && (isNaN($this.attr('height')) || isNaN($this.attr('width'))))\n {\n $this.attr('height', 9);\n $this.attr('width', 16);\n }\n var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(),\n width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),\n aspectRatio = height / width;\n if(!$this.attr('name')){\n var videoName = 'fitvid' + $.fn.fitVids._count;\n $this.attr('name', videoName);\n $.fn.fitVids._count++;\n }\n $this.wrap('
').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+'%');\n $this.removeAttr('height').removeAttr('width');\n });\n });\n };\n\n // Internal counter for unique video names.\n $.fn.fitVids._count = 0;\n\n// Works with either jQuery or Zepto\n})( window.jQuery || window.Zepto );\n","/* eslint-env browser */\n\n/**\n * Gallery card support\n * Used on any individual post/page\n *\n * Detects when a gallery card has been used and applies sizing to make sure\n * the display matches what is seen in the editor.\n */\n\n(function (window, document) {\n var resizeImagesInGalleries = function resizeImagesInGalleries() {\n var images = document.querySelectorAll('.kg-gallery-image img');\n images.forEach(function (image) {\n var container = image.closest('.kg-gallery-image');\n var width = image.attributes.width.value;\n var height = image.attributes.height.value;\n var ratio = width / height;\n container.style.flex = ratio + ' 1 0%';\n });\n };\n\n document.addEventListener('DOMContentLoaded', resizeImagesInGalleries);\n})(window, document);\n","/* eslint-env browser */\n\n/**\n * Infinite Scroll\n * Used on all pages where there is a list of posts (homepage, tag index, etc).\n *\n * When the page is scrolled to 300px from the bottom, the next page of posts\n * is fetched by following the the that is output\n * by {{ghost_head}}.\n *\n * The individual post items are extracted from the fetched pages by looking for\n * a wrapper element with the class \"post-card\". Any found elements are appended\n * to the element with the class \"post-feed\" in the currently viewed page.\n */\n\n(function (window, document) {\n // next link element\n var nextElement = document.querySelector('link[rel=next]');\n if (!nextElement) {\n return;\n }\n\n // post feed element\n var feedElement = document.querySelector('.post-feed');\n if (!feedElement) {\n return;\n }\n\n var buffer = 300;\n\n var ticking = false;\n var loading = false;\n\n var lastScrollY = window.scrollY;\n var lastWindowHeight = window.innerHeight;\n var lastDocumentHeight = document.documentElement.scrollHeight;\n\n function onPageLoad() {\n if (this.status === 404) {\n window.removeEventListener('scroll', onScroll);\n window.removeEventListener('resize', onResize);\n return;\n }\n\n // append contents\n var postElements = this.response.querySelectorAll('.post-card');\n postElements.forEach(function (item) {\n // document.importNode is important, without it the item's owner\n // document will be different which can break resizing of\n // `object-fit: cover` images in Safari\n feedElement.appendChild(document.importNode(item, true));\n });\n\n // set next link\n var resNextElement = this.response.querySelector('link[rel=next]');\n if (resNextElement) {\n nextElement.href = resNextElement.href;\n } else {\n window.removeEventListener('scroll', onScroll);\n window.removeEventListener('resize', onResize);\n }\n\n // sync status\n lastDocumentHeight = document.documentElement.scrollHeight;\n ticking = false;\n loading = false;\n }\n\n function onUpdate() {\n // return if already loading\n if (loading) {\n return;\n }\n\n // return if not scroll to the bottom\n if (lastScrollY + lastWindowHeight <= lastDocumentHeight - buffer) {\n ticking = false;\n return;\n }\n\n loading = true;\n\n var xhr = new window.XMLHttpRequest();\n xhr.responseType = 'document';\n\n xhr.addEventListener('load', onPageLoad);\n\n xhr.open('GET', nextElement.href);\n xhr.send(null);\n }\n\n function requestTick() {\n ticking || window.requestAnimationFrame(onUpdate);\n ticking = true;\n }\n\n function onScroll() {\n lastScrollY = window.scrollY;\n requestTick();\n }\n\n function onResize() {\n lastWindowHeight = window.innerHeight;\n lastDocumentHeight = document.documentElement.scrollHeight;\n requestTick();\n }\n\n window.addEventListener('scroll', onScroll, {passive: true});\n window.addEventListener('resize', onResize);\n\n requestTick();\n})(window, document);\n"]} \ No newline at end of file +{"version":3,"sources":["jquery.fitvids.js","gallery-card.js","infinite-scroll.js"],"names":["$","fn","fitVids","options","head","div","settings","customSelector","ignore","document","getElementById","getElementsByTagName","createElement","innerHTML","appendChild","childNodes","extend","this","each","selectors","push","ignoreList","$allVideos","find","join","not","aspectRatio","videoName","$this","parents","length","tagName","toLowerCase","parent","css","isNaN","attr","parseInt","height","width","_count","wrap","removeAttr","window","jQuery","Zepto","addEventListener","querySelectorAll","forEach","image","container","closest","ratio","attributes","value","style","flex","feedElement","buffer","ticking","loading","lastScrollY","lastWindowHeight","lastDocumentHeight","nextElement","querySelector","onPageLoad","status","removeEventListener","onScroll","onResize","response","item","importNode","resNextElement","href","documentElement","scrollHeight","onUpdate","xhr","XMLHttpRequest","responseType","open","send","requestTick","requestAnimationFrame","scrollY","innerHeight","passive"],"mappings":"CAYA,SAAAA,gBAIAA,EAAAC,GAAAC,QAAA,SAAAC,GACA,IAOAC,EAEAC,EATAC,EAAA,CACAC,eAAA,KACAC,OAAA,MAgBA,OAbAC,SAAAC,eAAA,oBAEAN,EAAAK,SAAAL,MAAAK,SAAAE,qBAAA,QAAA,IAEAN,EAAAI,SAAAG,cAAA,QACAC,UAAA,oUACAT,EAAAU,YAAAT,EAAAU,WAAA,KAGAZ,GACAH,EAAAgB,OAAAV,EAAAH,GAGAc,KAAAC,KAAA,WACA,IAAAC,EAAA,CACA,kCACA,6BACA,sCACA,oDACA,SACA,SAGAb,EAAAC,gBACAY,EAAAC,KAAAd,EAAAC,gBAGA,IAAAc,EAAA,iBAEAf,EAAAE,SACAa,EAAAA,EAAA,KAAAf,EAAAE,QAGAc,EAAAtB,EAAAiB,MAAAM,KAAAJ,EAAAK,KAAA,OAEAF,GADAA,EAAAA,EAAAG,IAAA,kBACAA,IAAAJ,IAEAH,KAAA,WACA,IAYAQ,EAEAC,EAdAC,EAAA5B,EAAAiB,MACA,EAAAW,EAAAC,QAAAR,GAAAS,QAGA,UAAAb,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,KAAAsD,SAAAxB,iBAAA,qBACAC,QAAA,SAAAwB,GAIAf,EAAA3C,YAAAL,EAAAgE,WAAAD,GAAA,MAIA,IAAAE,EAAAzD,KAAAsD,SAAAN,cAAA,kBACAS,EACAV,EAAAW,KAAAD,EAAAC,MAEAhC,EAAAyB,oBAAA,SAAAC,GACA1B,EAAAyB,oBAAA,SAAAE,IAIAP,EAAAtD,EAAAmE,gBAAAC,aAEAjB,EADAD,GAAA,EAIA,SAAAmB,IAEA,IAYAC,EAZAnB,IAKAC,EAAAC,GAAAC,EAAAL,EACAC,GAAA,GAIAC,GAAA,GAEAmB,EAAA,IAAApC,EAAAqC,gBACAC,aAAA,WAEAF,EAAAjC,iBAAA,OAAAoB,GAEAa,EAAAG,KAAA,MAAAlB,EAAAW,MACAI,EAAAI,KAAA,QAGA,SAAAC,IACAzB,GAAAhB,EAAA0C,sBAAAP,GACAnB,GAAA,EAGA,SAAAU,IACAR,EAAAlB,EAAA2C,QACAF,IAGA,SAAAd,IACAR,EAAAnB,EAAA4C,YACAxB,EAAAtD,EAAAmE,gBAAAC,aACAO,KAtFApB,IAKAP,EAAAhD,EAAAwD,cAAA,iBAQAL,EADAD,IAFAD,EAAA,KAKAG,EAAAlB,EAAA2C,QACAxB,EAAAnB,EAAA4C,YACAxB,EAAAtD,EAAAmE,gBAAAC,aAwEAlC,EAAAG,iBAAA,SAAAuB,EAAA,CAAAmB,SAAA,IACA7C,EAAAG,iBAAA,SAAAwB,GAEAc,KA/FA,CAgGAzC,OAAAlC","file":"casper.js","sourcesContent":["/*jshint browser:true */\n/*!\n* FitVids 1.3\n*\n*\n* Copyright 2017, Chris Coyier + Dave Rupert + Ghost Foundation\n* This is an unofficial release, ported by John O'Nolan\n* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/\n* Released under the MIT license\n*\n*/\n\n;(function( $ ){\n\n 'use strict';\n\n $.fn.fitVids = function( options ) {\n var settings = {\n customSelector: null,\n ignore: null\n };\n\n if(!document.getElementById('fit-vids-style')) {\n // appendStyles: https://github.com/toddmotto/fluidvids/blob/master/dist/fluidvids.js\n var head = document.head || document.getElementsByTagName('head')[0];\n var css = '.fluid-width-video-container{flex-grow: 1;width:100%;}.fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}';\n var div = document.createElement(\"div\");\n div.innerHTML = '

x

';\n head.appendChild(div.childNodes[1]);\n }\n\n if ( options ) {\n $.extend( settings, options );\n }\n\n return this.each(function(){\n var selectors = [\n 'iframe[src*=\"player.vimeo.com\"]',\n 'iframe[src*=\"youtube.com\"]',\n 'iframe[src*=\"youtube-nocookie.com\"]',\n 'iframe[src*=\"kickstarter.com\"][src*=\"video.html\"]',\n 'object',\n 'embed'\n ];\n\n if (settings.customSelector) {\n selectors.push(settings.customSelector);\n }\n\n var ignoreList = '.fitvidsignore';\n\n if(settings.ignore) {\n ignoreList = ignoreList + ', ' + settings.ignore;\n }\n\n var $allVideos = $(this).find(selectors.join(','));\n $allVideos = $allVideos.not('object object'); // SwfObj conflict patch\n $allVideos = $allVideos.not(ignoreList); // Disable FitVids on this video.\n\n $allVideos.each(function(){\n var $this = $(this);\n if($this.parents(ignoreList).length > 0) {\n return; // Disable FitVids on this video.\n }\n if (this.tagName.toLowerCase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; }\n if ((!$this.css('height') && !$this.css('width')) && (isNaN($this.attr('height')) || isNaN($this.attr('width'))))\n {\n $this.attr('height', 9);\n $this.attr('width', 16);\n }\n var height = ( this.tagName.toLowerCase() === 'object' || ($this.attr('height') && !isNaN(parseInt($this.attr('height'), 10))) ) ? parseInt($this.attr('height'), 10) : $this.height(),\n width = !isNaN(parseInt($this.attr('width'), 10)) ? parseInt($this.attr('width'), 10) : $this.width(),\n aspectRatio = height / width;\n if(!$this.attr('name')){\n var videoName = 'fitvid' + $.fn.fitVids._count;\n $this.attr('name', videoName);\n $.fn.fitVids._count++;\n }\n $this.wrap('
').parent('.fluid-width-video-wrapper').css('padding-top', (aspectRatio * 100)+'%');\n $this.removeAttr('height').removeAttr('width');\n });\n });\n };\n\n // Internal counter for unique video names.\n $.fn.fitVids._count = 0;\n\n// Works with either jQuery or Zepto\n})( window.jQuery || window.Zepto );\n","/* eslint-env browser */\n\n/**\n * Gallery card support\n * Used on any individual post/page\n *\n * Detects when a gallery card has been used and applies sizing to make sure\n * the display matches what is seen in the editor.\n */\n\n(function (window, document) {\n var resizeImagesInGalleries = function resizeImagesInGalleries() {\n var images = document.querySelectorAll('.kg-gallery-image img');\n images.forEach(function (image) {\n var container = image.closest('.kg-gallery-image');\n var width = image.attributes.width.value;\n var height = image.attributes.height.value;\n var ratio = width / height;\n container.style.flex = ratio + ' 1 0%';\n });\n };\n\n document.addEventListener('DOMContentLoaded', resizeImagesInGalleries);\n})(window, document);\n","/* eslint-env browser */\n\n/**\n * Infinite Scroll\n * Used on all pages where there is a list of posts (homepage, tag index, etc).\n *\n * When the page is scrolled to 300px from the bottom, the next page of posts\n * is fetched by following the the that is output\n * by {{ghost_head}}.\n *\n * The individual post items are extracted from the fetched pages by looking for\n * a wrapper element with the class \"post-card\". Any found elements are appended\n * to the element with the class \"post-feed\" in the currently viewed page.\n */\n\n(function (window, document) {\n // next link element\n var nextElement = document.querySelector('link[rel=next]');\n if (!nextElement) {\n return;\n }\n\n // post feed element\n var feedElement = document.querySelector('.post-feed');\n if (!feedElement) {\n return;\n }\n\n var buffer = 300;\n\n var ticking = false;\n var loading = false;\n\n var lastScrollY = window.scrollY;\n var lastWindowHeight = window.innerHeight;\n var lastDocumentHeight = document.documentElement.scrollHeight;\n\n function onPageLoad() {\n if (this.status === 404) {\n window.removeEventListener('scroll', onScroll);\n window.removeEventListener('resize', onResize);\n return;\n }\n\n // append contents\n var postElements = this.response.querySelectorAll('article.post-card');\n postElements.forEach(function (item) {\n // document.importNode is important, without it the item's owner\n // document will be different which can break resizing of\n // `object-fit: cover` images in Safari\n feedElement.appendChild(document.importNode(item, true));\n });\n\n // set next link\n var resNextElement = this.response.querySelector('link[rel=next]');\n if (resNextElement) {\n nextElement.href = resNextElement.href;\n } else {\n window.removeEventListener('scroll', onScroll);\n window.removeEventListener('resize', onResize);\n }\n\n // sync status\n lastDocumentHeight = document.documentElement.scrollHeight;\n ticking = false;\n loading = false;\n }\n\n function onUpdate() {\n // return if already loading\n if (loading) {\n return;\n }\n\n // return if not scroll to the bottom\n if (lastScrollY + lastWindowHeight <= lastDocumentHeight - buffer) {\n ticking = false;\n return;\n }\n\n loading = true;\n\n var xhr = new window.XMLHttpRequest();\n xhr.responseType = 'document';\n\n xhr.addEventListener('load', onPageLoad);\n\n xhr.open('GET', nextElement.href);\n xhr.send(null);\n }\n\n function requestTick() {\n ticking || window.requestAnimationFrame(onUpdate);\n ticking = true;\n }\n\n function onScroll() {\n lastScrollY = window.scrollY;\n requestTick();\n }\n\n function onResize() {\n lastWindowHeight = window.innerHeight;\n lastDocumentHeight = document.documentElement.scrollHeight;\n requestTick();\n }\n\n window.addEventListener('scroll', onScroll, {passive: true});\n window.addEventListener('resize', onResize);\n\n requestTick();\n})(window, document);\n"]} \ No newline at end of file diff --git a/assets/js/infinite-scroll.js b/assets/js/infinite-scroll.js index dd34d41..3e9bd7a 100644 --- a/assets/js/infinite-scroll.js +++ b/assets/js/infinite-scroll.js @@ -43,7 +43,7 @@ } // append contents - var postElements = this.response.querySelectorAll('.post-card'); + var postElements = this.response.querySelectorAll('article.post-card'); postElements.forEach(function (item) { // document.importNode is important, without it the item's owner // document will be different which can break resizing of