aboutsummaryrefslogtreecommitdiff
path: root/app/views/javascript
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2012-10-30 22:30:40 +0100
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2012-10-30 22:30:40 +0100
commit0f2891f4325d6f88845790393d006883831118fd (patch)
tree29720da808978990185a9ca5987a09621a8149d5 /app/views/javascript
parent3a8a6d2d56c468af924936a80e110727bc503594 (diff)
Fix issue #8 : ajoute le nombre de non lus pour les catégories (mérite amélioration ?)
Diffstat (limited to 'app/views/javascript')
-rw-r--r--app/views/javascript/main.phtml22
1 files changed, 4 insertions, 18 deletions
diff --git a/app/views/javascript/main.phtml b/app/views/javascript/main.phtml
index 9283c89cb..710b04988 100644
--- a/app/views/javascript/main.phtml
+++ b/app/views/javascript/main.phtml
@@ -35,28 +35,14 @@ function slide (new_active, old_active) {
}
function add_not_read (nb) {
- span_not_read = $("#main_aside #menu a span.nb_not_read");
+ span_not_read = $("#categories li.all span.nb_not_read");
html = span_not_read.html ();
- if (html == "" && nb > 0) {
- nb_not_read = nb;
- } else if (html != "") {
- regex = /\((\d+) non lus?\)/;
- nb_not_read = parseInt (regex.exec (html)[1]) + nb;
- } else {
- nb_not_read = 0;
- }
- pluriel = "";
- if (nb_not_read > 1) {
- pluriel = "s";
- }
+ regex = /(\d+)/;
+ nb_not_read = parseInt (regex.exec (html)[1]) + nb;
- if (nb_not_read > 0) {
- span_not_read.html ("(" + nb_not_read + " non lu" + pluriel + ")");
- } else {
- span_not_read.html ("");
- }
+ span_not_read.html (nb_not_read);
}
function mark_read (active) {