aboutsummaryrefslogtreecommitdiff
path: root/p/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'p/scripts')
-rw-r--r--p/scripts/main.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/p/scripts/main.js b/p/scripts/main.js
index 4939bf7dd..82dc79ce7 100644
--- a/p/scripts/main.js
+++ b/p/scripts/main.js
@@ -297,6 +297,9 @@ function mark_favorite(div) {
});
}
+var freshrssOpenArticleEvent = document.createEvent('Event');
+freshrssOpenArticleEvent.initEvent('freshrss:openArticle', true, true);
+
function toggleContent(new_active, old_active, skipping) {
// If skipping, move current without activating or marking as read
if (!new_active) {
@@ -348,8 +351,11 @@ function toggleContent(new_active, old_active, skipping) {
box_to_move.scrollTop = new_pos;
}
- if (context.auto_mark_article && new_active.classList.contains('active') && !skipping) {
- mark_read(new_active, true);
+ if (new_active.classList.contains('active') && !skipping) {
+ if (context.auto_mark_article) {
+ mark_read(new_active, true);
+ }
+ new_active[0].dispatchEvent(freshrssOpenArticleEvent);
}
onScroll();
}