From 43e3a2d69dc6343f3e30e7c3e3e1cb396a5650a1 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 6 Apr 2019 16:45:21 +0200 Subject: Fix autoremove again (#2352) Fix https://github.com/FreshRSS/FreshRSS/pull/2349 --- p/scripts/main.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'p') diff --git a/p/scripts/main.js b/p/scripts/main.js index 286764d22..a44a22c6a 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -163,6 +163,9 @@ function incUnreadsTag(tag_id, nb) { } function removeArticle(div) { + if (!div || div.classList.contains('active') || div.classList.contains('not_read')) { + return; + } let scrollTop = box_to_follow.scrollTop; let dirty = false; const p = div.previousElementSibling, @@ -384,6 +387,9 @@ function toggleContent(new_active, old_active, skipping) { if (old_active) { old_active.classList.remove('active'); old_active.classList.remove('current'); //Split for IE11 + if (context.auto_remove_article) { + removeArticle(old_active); + } } } else { new_active.classList.toggle('active'); -- cgit v1.2.3