From 4219214c03974705ce5fa5eb07adffb89141cb50 Mon Sep 17 00:00:00 2001 From: jalletto Date: Sun, 31 Mar 2019 14:51:00 -0500 Subject: [PATCH] add offset to Waypoint so new dweets load before scrolling to the bottom. --- dwitter/static/js/scrolling.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dwitter/static/js/scrolling.js b/dwitter/static/js/scrolling.js index 4d03b26f..10d29202 100644 --- a/dwitter/static/js/scrolling.js +++ b/dwitter/static/js/scrolling.js @@ -43,6 +43,9 @@ window.onload = function() { element: $('.dweet-feed')[0], items: '.dweet-wrapper, .loading, .end-of-feed', more: '.next-page', + offset: function() { + return (Waypoint.viewportHeight() - this.element.clientHeight) + 200; + }, onAfterPageLoad: function(items) { $('.loading:not(:last-of-type)').hide();