summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-11-09 00:46:43 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-11-09 00:46:43 +0100
commitbdb69080f8d0bf50aa7d297ba5c5e992f05bdcd0 (patch)
tree410923de7f63cf22a63a092c2c5914c1a63478e8 /public
parentac7b805140ce6b40ab5cc8ca510d51fa13b2734c (diff)
Affichage dynamique des favoris non lus
Corrige https://github.com/marienfressinaud/FreshRSS/issues/222 Il reste toujours une situation curieuse lorsqu'on a fini de lire tous les favoris non-lus, mais à voir une autre fois
Diffstat (limited to 'public')
-rw-r--r--public/scripts/main.js23
1 files changed, 13 insertions, 10 deletions
diff --git a/public/scripts/main.js b/public/scripts/main.js
index 3d4c1f30a..9723e617d 100644
--- a/public/scripts/main.js
+++ b/public/scripts/main.js
@@ -72,6 +72,13 @@ function mark_read(active, only_not_read) {
elem.setAttribute('data-unread', Math.max(0, feed_unread + inc));
}
+ //Update unread: favourites
+ if (active.closest('div').hasClass('favorite')) {
+ elem = $('#aside_flux .favorites').children(':first').get(0);
+ feed_unread = elem ? (parseInt(elem.getAttribute('data-unread'), 10) || 0) : 0;
+ elem.setAttribute('data-unread', Math.max(0, feed_unread + inc));
+ }
+
//Update unread: title
document.title = document.title.replace(/((?: \(\d+\))?)( - .*?)((?: \(\d+\))?)$/, function (m, p1, p2, p3) {
return incLabel(p1, inc) + p2 + incLabel(p3, feed_priority > 0 ? inc : 0);
@@ -112,6 +119,12 @@ function mark_favorite(active) {
return incLabel(p1, inc);
});
}
+
+ if (active.closest('div').hasClass('not_read')) {
+ var elem = $('#aside_flux .favorites').children(':first').get(0),
+ feed_unread = elem ? (parseInt(elem.getAttribute('data-unread'), 10) || 0) : 0;
+ elem.setAttribute('data-unread', Math.max(0, feed_unread + inc));
+ }
});
}
@@ -193,15 +206,6 @@ function next_entry() {
}
}
-/*function init_img() {
- var maxWidth = $(".flux_content .content").width() / 2;
- $(".flux_content .content img").each(function () {
- if ($(this).width() > maxWidth) {
- $(this).addClass("big");
- }
- });
-}*/
-
function inMarkViewport(flux, box_to_follow, relative_follow) {
var top = flux.position().top;
if (relative_follow) {
@@ -229,7 +233,6 @@ function init_lazyload() {
}
function init_posts() {
- //init_img(); //Alex
init_lazyload();
var box_to_follow = $(window),