fix: init robuste avant <body>, pas de repli tardif au-dessus de l'écran, README
- écoute freshrss:load-more sur document (script async possiblement exécuté avant le parsing de <body>) - ne replie jamais après coup un article qui commence au-dessus de l'écran : la page sauterait et des articles non vus seraient marqués lus - README : l'image officielle n'a pas git, installation depuis l'hôte Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ccb230d514
commit
66d997cc6e
4 files changed
+66
-10
No files matched your search
+7
-1
@@ -42,6 +42,11 @@
|
||||
if (state !== undefined && state !== STATE.short) {
|
||||
return;
|
||||
}
|
||||
// Re-evaluating a short entry: never shrink one that starts above the viewport,
|
||||
// the page would jump up and unseen articles could be marked read on next scroll.
|
||||
if (state === STATE.short && flux.getBoundingClientRect().top < 0) {
|
||||
return;
|
||||
}
|
||||
const text = flux.querySelector('.text');
|
||||
if (!text) {
|
||||
return;
|
||||
@@ -71,7 +76,8 @@
|
||||
};
|
||||
const doc = win.document;
|
||||
processEntries(doc, opts);
|
||||
doc.body.addEventListener('freshrss:load-more', () => processEntries(doc, opts));
|
||||
// Listen on document: async scripts may run before <body> exists; the event bubbles.
|
||||
doc.addEventListener('freshrss:load-more', () => processEntries(doc, opts));
|
||||
// Late-loading images can make a "short" article long enough to collapse.
|
||||
doc.addEventListener('load', function (ev) {
|
||||
const target = ev.target;
|
||||
|
||||
Reference in new issue
Block a user