diff options
| author | 2014-01-27 23:27:42 +0100 | |
|---|---|---|
| committer | 2014-01-27 23:27:42 +0100 | |
| commit | 2fe2f876eac5e5fb8730000ef3d32ab45eefa8ea (patch) | |
| tree | a0ee5722cd06c7414cd2f0d74ea5eca5a617cf84 | |
| parent | ec48755fc163bc1c975cdf53c2f19a19d6a1ade7 (diff) | |
Corrige mise à jour titre en JavaScript
Le nombre de non lus n'était pas mis à jour correctement.
Voir #398 (comments)
| -rw-r--r-- | p/scripts/main.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/p/scripts/main.js b/p/scripts/main.js index 4ee861ade..921005e3c 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -75,15 +75,21 @@ function incUnreadsFeed(article, feed_id, nb) { var isCurrentView = false; //Update unread: title - document.title = document.title.replace(/((?: \(\d+\))?)( · .*?)((?: \(\d+\))?)$/, function (m, p1, p2, p3) { + document.title = document.title.replace(/^([^\(]*)((?: \([0-9 ]+\))?)( · .*?)((?: \([0-9 ]+\))?)$/, function(m, p1, p2, p3, p4) { var $feed = $('#' + feed_id); - if (article || ($feed.closest('.active').length > 0 && $feed.siblings('.active').length === 0)) { + + p2 = p2.replace(/ /g, ''); + p4 = p4.replace(/ /g, ''); + + if ($('.category.all > .active').length == 0 && $('.category.favorites > .active').length == 0) { // If the current page is not the home page or the favorites page isCurrentView = true; - return incLabel(p1, nb) + p2 + incLabel(p3, feed_priority > 0 ? nb : 0); + return p1 + incLabel(p2, nb) + p3 + incLabel(p4, feed_priority > 0 ? nb : 0); } else { - return p1 + p2 + incLabel(p3, feed_priority > 0 ? nb : 0); + return p1 + p3 + incLabel(p4, feed_priority > 0 ? nb : 0); } + }); + return isCurrentView; } |
