aboutsummaryrefslogtreecommitdiff
path: root/p/scripts
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-10-16 16:10:58 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-10-16 16:10:58 +0200
commit6cd38d73d0b41ea7cd4da1fe611d761d7d442f2b (patch)
tree7fcf3bdeb12d234e838f7afaa50769b4e5d468d2 /p/scripts
parent3f78bad3970113f14b80db19808e2c58af8fb19e (diff)
mark_read optimisation
Diffstat (limited to 'p/scripts')
-rw-r--r--p/scripts/main.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/p/scripts/main.js b/p/scripts/main.js
index 138a223de..51323a969 100644
--- a/p/scripts/main.js
+++ b/p/scripts/main.js
@@ -116,8 +116,8 @@ function incUnreadsFeed(article, feed_id, nb) {
var pending_entries = {};
function mark_read(active, only_not_read) {
- if (active.length === 0 || active.attr('id') == '' ||
- (only_not_read === true && !active.hasClass("not_read"))) {
+ if ((active.length === 0) || (!active.attr('id')) ||
+ (only_not_read && !active.hasClass("not_read"))) {
return false;
}
@@ -142,7 +142,7 @@ function mark_read(active, only_not_read) {
if (active.hasClass("not_read")) {
active.removeClass("not_read");
inc--;
- } else if (only_not_read !== true || active.hasClass("not_read")) {
+ } else {
active.addClass("not_read");
active.addClass("keep_unread");
inc++;