diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2012-08-14 17:56:49 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2012-08-14 17:56:49 +0200 |
commit | 0613bf9d4f7f28ab64066c24b188aeb58ad30fba (patch) | |
tree | 62c4b3143c4b2e9ab959c0a33ae41e7769613088 | |
parent | 9bcaa424d04ec85f75f6e86dbdc04205e01c4fd5 (diff) |
make folders immediately show up in the feedlist if theres no parentfolder
-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); |