From d19824b919289ad63743f27da7861f2422da5baa Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 26 Jul 2014 13:56:44 +0200 Subject: Hide read feeds and read categories when in unread mode https://github.com/marienfressinaud/FreshRSS/issues/430 There are some repeated HTML attributes (`data-unread` and `active`) which could maybe be simplified. If some people do not like this behaviour, we could consider having an option. --- p/scripts/main.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'p/scripts') diff --git a/p/scripts/main.js b/p/scripts/main.js index d0f3c27e9..1cc26f57f 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -69,6 +69,10 @@ function incUnreadsFeed(article, feed_id, nb) { feed_priority = elem ? str2int(elem.getAttribute('data-priority')) : 0; if (elem) { elem.setAttribute('data-unread', numberFormat(feed_unreads + nb)); + elem = $(elem).closest('li').get(0); + if (elem) { + elem.setAttribute('data-unread', feed_unreads + nb); + } } //Update unread: category @@ -76,6 +80,10 @@ function incUnreadsFeed(article, feed_id, nb) { feed_unreads = elem ? str2int(elem.getAttribute('data-unread')) : 0; if (elem) { elem.setAttribute('data-unread', numberFormat(feed_unreads + nb)); + elem = $(elem).closest('li').get(0); + if (elem) { + elem.setAttribute('data-unread', feed_unreads + nb); + } } //Update unread: all -- cgit v1.2.3