summaryrefslogtreecommitdiffstats
path: root/js/items.js
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2012-09-01 01:19:47 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2012-09-01 01:19:47 +0200
commit4c39312cb3ffba28b103e49ac37f293fc5eea78b (patch)
tree2e36d1f90cf9de4fb3f7f1ad4348e38698da9d2c /js/items.js
parent069f27346d84d9cb39cba4190d81e73402df61d1 (diff)
folders are now correctly transformed when it contains hidden items
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() {