From e79b401e97c15b6a9a492e9e50ed0d791a6da1b7 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 9 Jun 2014 13:23:27 +0400 Subject: getPreviousFeed: wrap to last feed to be consistent with getNextFeed --- js/FeedTree.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/FeedTree.js') diff --git a/js/FeedTree.js b/js/FeedTree.js index e35417daf..4ae82d8d9 100644 --- a/js/FeedTree.js +++ b/js/FeedTree.js @@ -539,7 +539,7 @@ dojo.declare("fox.FeedTree", dijit.Tree, { } items = this.model.store._arrayOfAllItems; - var item = items[0]; + var item = items[0] == treeItem ? items[items.length-1] : items[0]; for (var i = 0; i < items.length; i++) { if (items[i] == treeItem) { -- cgit v1.2.3-54-g00ecf From d922b09c4356ffb88a3ffbf9a60ebb8f890fd7ce Mon Sep 17 00:00:00 2001 From: André Glüpker Date: Sat, 14 Jun 2014 12:37:05 +0200 Subject: 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. --- classes/pref/feeds.php | 1 + js/FeedTree.js | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'js/FeedTree.js') diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php index 6021978b7..43b474278 100644 --- a/classes/pref/feeds.php +++ b/classes/pref/feeds.php @@ -55,6 +55,7 @@ class Pref_Feeds extends Handler_Protected { $cat['unread'] = 0; $cat['child_unread'] = 0; $cat['auxcounter'] = 0; + $cat['parent_id'] = $cat_id; $cat['items'] = $this->get_category_items($line['id']); 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]; + } } } } -- cgit v1.2.3-54-g00ecf