summaryrefslogtreecommitdiffstats
path: root/js/items.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/items.js')
-rw-r--r--js/items.js28
1 files changed, 27 insertions, 1 deletions
diff --git a/js/items.js b/js/items.js
index cd54afda8..64a5f4d53 100644
--- a/js/items.js
+++ b/js/items.js
@@ -112,7 +112,13 @@ var t = t || function(app, string){ return string; }; // mock translation for lo
this._itemCache.empty();
};
-
+ /**
+ * Marks all items of a feed as read
+ * @param feedId the id of the feed which should be marked as read
+ */
+ Items.prototype.markAllRead = function(feedId) {
+ this._itemCache.markAllRead(feedId);
+ };
/**
* Returns the most recent id of a feed from the cache
@@ -185,6 +191,19 @@ var t = t || function(app, string){ return string; }; // mock translation for lo
return this._items[itemId];
};
+
+ /**
+ * Marks all items of a feed as read
+ * @param feedId the id of the feed which should be marked as read
+ */
+ Items.prototype.markAllRead = function(feedId) {
+ if(this._feeds[feedId] !== undefined){
+ $.each(this._feeds[feedId], function(key, value){
+ value.addReadClass();
+ });
+ }
+ };
+
/**
* Adds Html elements to the cache
* @param html the html for a complete list with items
@@ -398,6 +417,13 @@ var t = t || function(app, string){ return string; }; // mock translation for lo
};
/**
+ * Adds only the read class, used for marking all read
+ */
+ Item.prototype.addReadClass = function() {
+ this._$html.addClass('read');
+ };
+
+ /**
* Binds listeners on the feed item
*/
Item.prototype._bindItemEventListeners = function() {