forked from Elv1zz/ttrss_plugin-markasread
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmarkasread.js
More file actions
23 lines (20 loc) · 695 Bytes
/
markasread.js
File metadata and controls
23 lines (20 loc) · 695 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function markasreadClicked(evt, articleId) {
try {
// turn off "event bubbling" for this click.
// this is to avoid toggling the Unread state twice
// first by this method and
// second by the onclick event of the article row.
// (onclick of the row only marks the article as read,
// not unread again)
// code from: http://www.quirksmode.org/js/events_order.html
var e = evt || window.event;
e.cancelBubble = true;
if (e.stopPropagation) e.stopPropagation();
// toggle the articles unread state
// Unread will become Read
// Read will become Unread
Headlines.toggleUnread(articleId);
} catch (except) {
exception_error("markasreadClicked", except);
}
}