aboutsummaryrefslogtreecommitdiff
path: root/p/scripts
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-24 15:08:57 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-24 15:08:57 +0200
commit15316b77f6dd94b46ec8bdac588e273aef259737 (patch)
tree1855864df3d98b40804698706eee6529aca3b4a3 /p/scripts
parentbd5757fff83844fef08fb50d0fce3b1d104728dc (diff)
Fix last sections of main.js
See https://github.com/marienfressinaud/FreshRSS/issues/634
Diffstat (limited to 'p/scripts')
-rw-r--r--p/scripts/main.js22
1 files changed, 11 insertions, 11 deletions
diff --git a/p/scripts/main.js b/p/scripts/main.js
index 24c0972fc..b6370866f 100644
--- a/p/scripts/main.js
+++ b/p/scripts/main.js
@@ -61,18 +61,18 @@ function incUnreadsFeed(article, feed_id, nb) {
feed_priority = elem ? str2int(elem.getAttribute('data-priority')) : 0;
if (elem) {
elem.setAttribute('data-unread', feed_unreads + nb);
- elem = $(elem).children('a').get(0);
+ elem = $(elem).children('.item-title').get(0);
if (elem) {
elem.setAttribute('data-unread', numberFormat(feed_unreads + nb));
}
}
//Update unread: category
- elem = $('#' + feed_id).parents('.tree-folder').get(0);
+ elem = $('#' + feed_id).parents('.category').get(0);
feed_unreads = elem ? str2int(elem.getAttribute('data-unread')) : 0;
if (elem) {
elem.setAttribute('data-unread', feed_unreads + nb);
- elem = $(elem).find('.tree-folder-title .title').get(0);
+ elem = $(elem).find('.title').get(0);
if (elem) {
elem.setAttribute('data-unread', numberFormat(feed_unreads + nb));
}
@@ -80,7 +80,7 @@ function incUnreadsFeed(article, feed_id, nb) {
//Update unread: all
if (feed_priority > 0) {
- elem = $('#aside_feed .all .tree-folder-title .title').get(0);
+ elem = $('#aside_feed .all .title').get(0);
if (elem) {
feed_unreads = elem ? str2int(elem.getAttribute('data-unread')) : 0;
elem.setAttribute('data-unread', numberFormat(feed_unreads + nb));
@@ -89,7 +89,7 @@ function incUnreadsFeed(article, feed_id, nb) {
//Update unread: favourites
if (article && article.closest('div').hasClass('favorite')) {
- elem = $('#aside_feed .favorites .tree-folder-title .title').get(0);
+ elem = $('#aside_feed .favorites .title').get(0);
if (elem) {
feed_unreads = elem ? str2int(elem.getAttribute('data-unread')) : 0;
elem.setAttribute('data-unread', numberFormat(feed_unreads + nb));
@@ -194,7 +194,7 @@ function mark_favorite(active) {
}
$b.find('.icon').replaceWith(data.icon);
- var favourites = $('#aside_feed .favorites .tree-folder-title .title').contents().last().get(0);
+ var favourites = $('#aside_feed .favorites .title').contents().last().get(0);
if (favourites && favourites.textContent) {
favourites.textContent = favourites.textContent.replace(/((?: \([ 0-9]+\))?\s*)$/, function (m, p1) {
return incLabel(p1, inc, false);
@@ -202,7 +202,7 @@ function mark_favorite(active) {
}
if (active.closest('div').hasClass('not_read')) {
- var elem = $('#aside_feed .favorites .tree-folder-title .title').get(0),
+ var elem = $('#aside_feed .favorites .title').get(0),
feed_unreads = elem ? str2int(elem.getAttribute('data-unread')) : 0;
if (elem) {
elem.setAttribute('data-unread', numberFormat(feed_unreads + inc));
@@ -876,12 +876,12 @@ function init_notifs_html5() {
function refreshUnreads() {
$.getJSON('./?c=javascript&a=nbUnreadsPerFeed').done(function (data) {
- var isAll = $('.category.all > .active').length > 0,
+ var isAll = $('.category.all.active').length > 0,
new_articles = false;
$.each(data, function(feed_id, nbUnreads) {
feed_id = 'f_' + feed_id;
- var elem = $('#' + feed_id + '>.feed').get(0),
+ var elem = $('#' + feed_id).get(0),
feed_unreads = elem ? str2int(elem.getAttribute('data-unread')) : 0;
if ((incUnreadsFeed(null, feed_id, nbUnreads - feed_unreads) || isAll) && //Update of current view?
@@ -891,7 +891,7 @@ function refreshUnreads() {
};
});
- var nb_unreads = str2int($('.category.all>a').attr('data-unread'));
+ var nb_unreads = str2int($('.category.all .title').attr('data-unread'));
if (nb_unreads > 0 && new_articles) {
faviconNbUnread(nb_unreads);
@@ -1136,7 +1136,7 @@ function init_password_observers() {
function faviconNbUnread(n) {
if (typeof n === 'undefined') {
- n = str2int($('.category.all>a').attr('data-unread'));
+ n = str2int($('.category.all .title').attr('data-unread'));
}
//http://remysharp.com/2010/08/24/dynamic-favicons/
var canvas = document.createElement('canvas'),