mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 16:45:55 +00:00
Merge pull request #379 from Joschasa/getNextUnreadFeed_skip_nested
Skip nested Cats/Feeds when calling getNextUnreadFeed()
This commit is contained in:
@@ -55,6 +55,7 @@ class Pref_Feeds extends Handler_Protected {
|
|||||||
$cat['unread'] = 0;
|
$cat['unread'] = 0;
|
||||||
$cat['child_unread'] = 0;
|
$cat['child_unread'] = 0;
|
||||||
$cat['auxcounter'] = 0;
|
$cat['auxcounter'] = 0;
|
||||||
|
$cat['parent_id'] = $cat_id;
|
||||||
|
|
||||||
$cat['items'] = $this->get_category_items($line['id']);
|
$cat['items'] = $this->get_category_items($line['id']);
|
||||||
|
|
||||||
|
|||||||
@@ -58,12 +58,12 @@ dojo.declare("fox.FeedStoreModel", dijit.tree.ForestStoreModel, {
|
|||||||
|
|
||||||
if (is_cat) {
|
if (is_cat) {
|
||||||
treeItem = this.store._itemsByIdentity['CAT:' + feed];
|
treeItem = this.store._itemsByIdentity['CAT:' + feed];
|
||||||
items = this.store._arrayOfTopLevelItems;
|
|
||||||
} else {
|
} else {
|
||||||
treeItem = this.store._itemsByIdentity['FEED:' + feed];
|
treeItem = this.store._itemsByIdentity['FEED:' + feed];
|
||||||
items = this.store._arrayOfAllItems;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
items = this.store._arrayOfAllItems;
|
||||||
|
|
||||||
for (var i = 0; i < items.length; i++) {
|
for (var i = 0; i < items.length; i++) {
|
||||||
if (items[i] == treeItem) {
|
if (items[i] == treeItem) {
|
||||||
|
|
||||||
@@ -71,14 +71,18 @@ dojo.declare("fox.FeedStoreModel", dijit.tree.ForestStoreModel, {
|
|||||||
var unread = this.store.getValue(items[j], 'unread');
|
var unread = this.store.getValue(items[j], 'unread');
|
||||||
var id = this.store.getValue(items[j], 'id');
|
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++) {
|
for (var j = 0; j < i; j++) {
|
||||||
var unread = this.store.getValue(items[j], 'unread');
|
var unread = this.store.getValue(items[j], 'unread');
|
||||||
var id = this.store.getValue(items[j], 'id');
|
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];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user