summaryrefslogtreecommitdiff
path: root/js/FeedTree.js
diff options
context:
space:
mode:
authorAndré Glüpker <[email protected]>2014-06-14 12:37:05 +0200
committerAndré Glüpker <[email protected]>2014-06-14 12:37:05 +0200
commitd922b09c4356ffb88a3ffbf9a60ebb8f890fd7ce (patch)
tree35977d8094beb6ddf71b6160d3f4990daa563ce0 /js/FeedTree.js
parent1fa5c5409ddd36c1ceac6eb8bfcb19f35f89662e (diff)
Skip nested Feed when calling getNextUnreadFeed()
This function is only called when using "Mark all as read". So every time, this function gets called right now, all nested categories get marked as read as well, so we don't want to jump to them. Instead we want to the next category with same or higher tier.
Diffstat (limited to 'js/FeedTree.js')
-rw-r--r--js/FeedTree.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/js/FeedTree.js b/js/FeedTree.js
index 4ae82d8d9..6c06f00d5 100644
--- a/js/FeedTree.js
+++ b/js/FeedTree.js
@@ -58,12 +58,12 @@ dojo.declare("fox.FeedStoreModel", dijit.tree.ForestStoreModel, {
if (is_cat) {
treeItem = this.store._itemsByIdentity['CAT:' + feed];
- items = this.store._arrayOfTopLevelItems;
} else {
treeItem = this.store._itemsByIdentity['FEED:' + feed];
- items = this.store._arrayOfAllItems;
}
+ items = this.store._arrayOfAllItems;
+
for (var i = 0; i < items.length; i++) {
if (items[i] == treeItem) {
@@ -71,14 +71,18 @@ dojo.declare("fox.FeedStoreModel", dijit.tree.ForestStoreModel, {
var unread = this.store.getValue(items[j], 'unread');
var id = this.store.getValue(items[j], 'id');
- if (unread > 0 && (is_cat || id.match("FEED:"))) return items[j];
+ if (unread > 0 && ((is_cat && id.match("CAT:")) || (!is_cat && id.match("FEED:")))) {
+ if( !is_cat || ! (this.store.hasAttribute(items[j], 'parent_id') && this.store.getValue(items[j], 'parent_id') == feed) ) return items[j];
+ }
}
for (var j = 0; j < i; j++) {
var unread = this.store.getValue(items[j], 'unread');
var id = this.store.getValue(items[j], 'id');
- if (unread > 0 && (is_cat || id.match("FEED:"))) return items[j];
+ if (unread > 0 && ((is_cat && id.match("CAT:")) || (!is_cat && id.match("FEED:")))) {
+ if( !is_cat || ! (this.store.hasAttribute(items[j], 'parent_id') && this.store.getValue(items[j], 'parent_id') == feed) ) return items[j];
+ }
}
}
}