1/* global baseProInfiniteConfig */ 2/** 3 * File post-infinite-scroll.js. 4 * Gets single post infinite scroll working. 5 */ 6 7(function() { 8 'use strict'; 9 window.baseProInfiniteEvents = { 10 // Initiate scroll when the DOM loads. 11 init: function() { 12 var infScrollContainer = document.querySelector( '.content-wrap[data-infinite-scroll]' ); 13 // No point if no container. 14 if ( ! infScrollContainer.dataset || ! infScrollContainer.dataset.infiniteScroll ) { 15 return; 16 } 17 let parsedData = JSON.parse( infScrollContainer.dataset.infiniteScroll ); 18 var infScroll = new InfiniteScroll( '.content-wrap[data-infinite-scroll]', { 19 path: parsedData.path, 20 append: parsedData.append, 21 hideNav:parsedData.hideNav, 22 status: parsedData.status, 23 } ); 24 infScroll.on( 'append', function( body, path, items, response ) { 25 const event = new Event('baseJSInitReload'); 26 document.dispatchEvent( event ); 27 }); 28 } 29 } 30 if ( 'loading' === document.readyState ) { 31 // The DOM has not yet been loaded. 32 document.addEventListener( 'DOMContentLoaded', window.baseProInfiniteEvents.init ); 33 } else { 34 // The DOM has already been loaded. 35 window.baseProInfiniteEvents.init(); 36 } 37})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.