plutopluto

git clone https://git.ce9e.org/plutopluto.git

commit
5e87779a7fc04498c675a0e298cc2f066506b52b
parent
23e1eecc770ba32b9ae3be175933dee6af7cdd33
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2023-12-21 11:42
tweak js

Diffstat

M plutopluto/static/plutopluto.js 11 ++++-------

1 files changed, 4 insertions, 7 deletions


diff --git a/plutopluto/static/plutopluto.js b/plutopluto/static/plutopluto.js

@@ -102,17 +102,14 @@ getConfig().then(config => {
  102   102 
  103   103 		Promise.all(promises).finally(() => {
  104   104 			// now that we have entries, we can show some
  105    -1 			if (stream.children.length === 0) {
  106    -1 				loadMore();
  107    -1 			}
  108    -1 
   -1   105 			renderMore();
  109   106 			loadNextPageLock = false;
  110   107 		});
  111   108 
  112   109 		page++;
  113   110 	};
  114   111 
  115    -1 	var loadMore = function() {
   -1   112 	var renderMore = function() {
  116   113 		entries.sort((a, b) => {
  117   114 			return b.dt - a.dt;
  118   115 		});
@@ -124,11 +121,11 @@ getConfig().then(config => {
  124   121 
  125   122 	document.addEventListener('scroll', () => {
  126   123 		if (bottomDistance() < 4000) {
  127    -1 			loadMore();
   -1   124 			renderMore();
  128   125 		}
  129   126 	}, {passive: true});
  130   127 
  131    -1 	loading.addEventListener('click', loadMore);
   -1   128 	loading.addEventListener('click', renderMore);
  132   129 
  133   130 	// load initial content
  134   131 	loadNextPage();