diff options
-rw-r--r-- | js/news.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/js/news.js b/js/news.js index 71626b0c6..30412d065 100644 --- a/js/news.js +++ b/js/news.js @@ -59,10 +59,16 @@ News={ var url; url = OC.filePath('news', 'ajax', 'createfolder.php'); + console.log(folderid); $.post(url, { name: displayname, parentid: folderid }, function(jsondata){ if(jsondata.status == 'success'){ - $('.collapsable_container[data-id="' + folderid + '"] > ul').append(jsondata.data.listfolder); + // if we got a parent folder + if(folderid > 0){ + $('.collapsable_container[data-id="' + folderid + '"] > ul').append(jsondata.data.listfolder); + } else { + $('#feeds').append(jsondata.data.listfolder); + } setupFeedList(); transformCollapsableTrigger(); $('#addfolder_dialog').dialog('destroy').remove(); @@ -124,7 +130,11 @@ News={ window.location.reload(); } else { if(jsondata.status == 'success'){ - $('.collapsable_container[data-id="' + folderid + '"] > ul').append(jsondata.data.listfeed); + if(folderid > 0){ + $('.collapsable_container[data-id="' + folderid + '"] > ul').append(jsondata.data.listfeed); + } else { + $('#feeds').append(jsondata.data.listfeed); + } setupFeedList(); News.Feed.load(jsondata.data.feedid); |