diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2012-09-01 22:06:46 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2012-09-01 22:06:46 +0200 |
commit | 2781817b362ab0f7c4f51224169b879a0d6376ce (patch) | |
tree | d5e905ca00d721d3b2282dfafaf43d573be345be /js/menu.js | |
parent | 37158f214163b73bf45a501b8c1bcaeafe478c7c (diff) |
fixed all read button, made the reader more responsing by not waiting for the server to add classes (mark read/set important/select feed)
Diffstat (limited to 'js/menu.js')
-rw-r--r-- | js/menu.js | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/js/menu.js b/js/menu.js index 468273fe8..2f1ce3dcf 100644 --- a/js/menu.js +++ b/js/menu.js @@ -273,6 +273,14 @@ var News = News || {}; }; /** + * Returns the value of show all + * @return true if show all + */ + Menu.prototype.isShowAll = function() { + return this._showAll; + }; + + /** * Shortcut for toggling show all */ Menu.prototype.toggleShowAll = function(){ @@ -286,8 +294,9 @@ var News = News || {}; */ Menu.prototype.load = function(type, id){ var self = this; - this._items.load(type, id, function(){ - self._setActiveFeed(type, id); + self._setActiveFeed(type, id); + + this._items.load(type, id, function(){ self.triggerHideRead(); }); }; @@ -373,9 +382,11 @@ var News = News || {}; // set timeout to avoid racecondition error var self = this; - setTimeout(function(){ + + // this is very annoying on start, do we need it? + /*setTimeout(function(){ self._updateUnreadCountAll(); - }, 1000); + }, 1000);*/ this.triggerHideRead(); }; @@ -608,14 +619,16 @@ var News = News || {}; mostRecentItemId: this._items.getMostRecentItemId(type, id) }; + self._items.markAllRead(type, id); + $.post(OC.filePath('news', 'ajax', 'setallitemsread.php'), data, function(jsonData) { if(jsonData.status == 'success'){ - self._items.markAllRead(type, id); self._updateUnreadCountAll(); } else { OC.dialogs.alert(jsonData.data.message, t('news', 'Error')); } }); + break; } }; |