1(function ($, Drupal) { 2 $.fn.LoadMoreAndPager = function ($selector) { 3 const matches = /(js-view-dom-id-\w+)/.exec($($selector).attr('class')); 4 const currentViewId = matches[1].replace('js-view-dom-id-', 'views_dom_id:'); 5 const view = Drupal.views.instances[currentViewId]; 6 once.remove('ajax-pager', view.$view); 7 Drupal.attachBehaviors(view.$view[0]); 8 }; 9 10 const $window = $(window); 11 const scroll_threshold = 0; 12 let vis_index = 0; 13 14 Drupal.behaviors.LoadMoreAndPager = { 15 attach : function(context, settings){ 16 once('load_more', '.pager__load_more_items.load_more_auto', context).forEach((el) => { 17 const $pager = $(el); 18 $window.bind('scroll.views_infinite_scroll_' + vis_index, function() { 19 if (window.innerHeight + window.pageYOffset > $pager.offset().top - scroll_threshold) { 20 $pager.find('a').click(); 21 $window.unbind('scroll.views_infinite_scroll_' + vis_index); 22 } 23 }); 24 vis_index++; 25 }); 26 } 27 } 28})(jQuery, Drupal);
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.