aboutsummaryrefslogtreecommitdiff
path: root/p/scripts
diff options
context:
space:
mode:
authorGravatar Alexis Degrugillier <github@ainw.org> 2014-11-02 10:05:26 -0500
committerGravatar Alexis Degrugillier <github@ainw.org> 2014-11-02 10:05:26 -0500
commit960f86ba20fdf7320c957141a9983d17c7e521fa (patch)
treeef89206983c84f4bd91d1482bcbab0457384a632 /p/scripts
parent0eae6ef6b41085e83f7ad9f946cd9cb116542759 (diff)
Add a feature to hide articles when they are read
This is a new reading option to hide articles when they are read. The hidding process occurs when the article is left for an other article. This way, even when the article is marked as read on opening, it is hidden only while navigating to an other article. I'm not really happy with the behavior when the "mark while scrolling" option is enabled. Please review. It is missing the i18n since we're not supposed to push them before it exists on i18n.freshrss.org. Or maybe I misunderstood the process. See #476
Diffstat (limited to 'p/scripts')
-rw-r--r--p/scripts/main.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/p/scripts/main.js b/p/scripts/main.js
index dc5428048..d1d31c801 100644
--- a/p/scripts/main.js
+++ b/p/scripts/main.js
@@ -231,6 +231,14 @@ function toggleContent(new_active, old_active) {
}
old_active.removeClass("active current");
new_active.addClass("current");
+ if (context['auto_remove_article'] && !old_active.hasClass('not_read')) {
+ var p = old_active.prev();
+ var n = old_active.next();
+ if (p.hasClass('day') && n.hasClass('day')) {
+ p.remove();
+ }
+ old_active.remove();
+ }
} else {
new_active.toggleClass('active');
}