diff options
-rw-r--r-- | js/main.js | 8 | ||||
-rw-r--r-- | js/menu.js | 23 |
2 files changed, 16 insertions, 15 deletions
diff --git a/js/main.js b/js/main.js index cfe9df6d0..708c018f8 100644 --- a/js/main.js +++ b/js/main.js @@ -15,7 +15,7 @@ var News = News || {}; $(document).ready(function(){ // config values - var menuUpdateIntervalMiliseconds = 200000; + var menuUpdateIntervalMiliseconds = 30000; // global object array for accessing instances News.Objects = {}; @@ -41,7 +41,7 @@ $(document).ready(function(){ $rootFolder.click(function(){ News.DropDownMenu.selectItem(this, 0); }); - $('#addfeed_dialog .menu').append($rootFolder); + $('#addfeed_dialog .menu').append($rootFolder); $('#feeds .folder').each(function(){ var title = $(this).children('.title').html(); @@ -85,7 +85,7 @@ $(document).ready(function(){ $('#changefolder_dialog input[type=submit]').click(function(){ News.Folder.changeName(this); - }); + }); $('#folder_add_submit').click(function(){ News.Folder.submit(this); @@ -121,7 +121,7 @@ $(document).ready(function(){ OC.dialogs.alert(jsonData.data.message, t('news', 'Error')); } }); - }); + }); $(document).click(function(event) { $('#feedfoldermenu').hide(); 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; }); |