aboutsummaryrefslogtreecommitdiff
path: root/p/scripts
diff options
context:
space:
mode:
authorGravatar Ben Passmore <contact@passbe.com> 2023-11-09 20:12:04 +1000
committerGravatar GitHub <noreply@github.com> 2023-11-09 11:12:04 +0100
commitb9939bdaac75233ab52c7c7a483d5e4feb4921a4 (patch)
tree768060a80dc121f31dbd4d2b9674e61a4d42bfad /p/scripts
parent44a7c54a5a6afb72937425cee0d53610e440ec60 (diff)
Added ability to mark articles as read on focus. (#5812)
* Added ability to mark entries as read on focus. Feature proposed in issue #5723. * make-fix-all + i18n fr * Use batch to save resources and increase performance * Use "keep_unread" * typo --------- Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'p/scripts')
-rw-r--r--p/scripts/main.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/p/scripts/main.js b/p/scripts/main.js
index b3876f628..ca52bac56 100644
--- a/p/scripts/main.js
+++ b/p/scripts/main.js
@@ -481,6 +481,9 @@ function prev_entry(skipping) {
} else {
new_active = document.querySelector('.flux');
}
+ if (context.auto_mark_focus && !new_active.classList.contains('keep_unread')) {
+ mark_read(new_active, true, true);
+ }
toggleContent(new_active, old_active, skipping);
}
@@ -496,6 +499,9 @@ function next_entry(skipping) {
} else {
new_active = document.querySelector('.flux');
}
+ if (context.auto_mark_focus && !new_active.classList.contains('keep_unread')) {
+ mark_read(new_active, true, true);
+ }
toggleContent(new_active, old_active, skipping);
}
@@ -511,6 +517,9 @@ function next_unread_entry(skipping) {
} else {
new_active = document.querySelector('.not_read');
}
+ if (context.auto_mark_focus && !new_active.classList.contains('keep_unread')) {
+ mark_read(new_active, true, true);
+ }
toggleContent(new_active, old_active, skipping);
}