diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2012-09-14 18:10:17 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2012-09-14 18:10:17 +0200 |
commit | 5a907a1a7ea54f3f0bd443660eb539ebe3a5a821 (patch) | |
tree | b4203ccfb3b4ee0a1eeef8325157d6cf910eefc7 /js/menu.js | |
parent | c2bfb2babca9ad97ee419a7a388fff615f7f93d0 (diff) |
fixed a bug which broke updating via ajax
Diffstat (limited to 'js/menu.js')
-rw-r--r-- | js/menu.js | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/js/menu.js b/js/menu.js index cd2e52d74..eaef655c3 100644 --- a/js/menu.js +++ b/js/menu.js @@ -116,10 +116,6 @@ var News = News || {}; var self = this; this._updatingCount = 0; this._updateInterval = updateIntervalMiliseconds; - setInterval(function(){ - self._updateUnreadCountAll(); - }, self._updateInterval); - this._items = items; this._showAll = $('#view').hasClass('show_all'); @@ -350,6 +346,10 @@ var News = News || {}; self._updateUnreadCountAll(); }, 3000); + setInterval(function(){ + self._updateUnreadCountAll(); + }, self._updateInterval); + this.triggerHideRead(); }; @@ -635,13 +635,14 @@ var News = News || {}; 'folderid':folderId }; $.post(OC.filePath('news', 'ajax', 'updatefeed.php'), data, function(jsonData){ - console.log(jsonData); - if(jsonData.status == 'success'){ - var newUnreadCount = jsonData.data.unreadcount; - // FIXME: starred items should also be set - self._setUnreadCount(MenuNodeType.Feed, feedId, newUnreadCount); - } else { - OC.dialogs.alert(jsonData.data.message, t('news', 'Error')); + if(jsonData.data !== undefined){ // FIXME: temporary fix + if(jsonData.status == 'success'){ + var newUnreadCount = jsonData.data.unreadcount; + // FIXME: starred items should also be set + self._setUnreadCount(MenuNodeType.Feed, feedId, newUnreadCount); + } else { + OC.dialogs.alert(jsonData.data.message, t('news', 'Error')); + } } self._updatingCount -= 1; }); |