diff options
author | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-11 21:38:20 +0200 |
---|---|---|
committer | Bernhard Posselt <nukeawhale@gmail.com> | 2013-04-11 21:38:20 +0200 |
commit | eda8fec5874ebd2ba48b458497cb315eb871105c (patch) | |
tree | b801eee009361a7e965d205de9d792498eb8d1fa /js/app/services | |
parent | b06fc20ddbadbc7522cd23a83a20975f43889890 (diff) |
autoselect folder when it was created and open folder if a feed gets added to it
Diffstat (limited to 'js/app/services')
-rw-r--r-- | js/app/services/bl/feedbl.coffee | 1 | ||||
-rw-r--r-- | js/app/services/bl/folderbl.coffee | 13 |
2 files changed, 13 insertions, 1 deletions
diff --git a/js/app/services/bl/feedbl.coffee b/js/app/services/bl/feedbl.coffee index 6ab3c54e5..4c9ff7c99 100644 --- a/js/app/services/bl/feedbl.coffee +++ b/js/app/services/bl/feedbl.coffee @@ -146,6 +146,7 @@ NewLoading, _ExistsError) -> url: url urlHash: urlHash folderId: parentId + unreadCount: 0 @_feedModel.add(feed) diff --git a/js/app/services/bl/folderbl.coffee b/js/app/services/bl/folderbl.coffee index 1084dd5b7..ddb1f88c4 100644 --- a/js/app/services/bl/folderbl.coffee +++ b/js/app/services/bl/folderbl.coffee @@ -34,6 +34,9 @@ ItemModel, ShowAll, _ExistsError)-> super(activeFeed, persistence, itemModel, @_feedType.Folder) + getById: (folderId) -> + return @_folderModel.getById(folderId) + delete: (folderId) -> @_folderModel.removeById(folderId) @_persistence.deleteFolder(folderId) @@ -43,6 +46,14 @@ ItemModel, ShowAll, _ExistsError)-> return @_feedBl.getFeedsOfFolder(folderId).length + open: (folderId) -> + folder = @_folderModel.getById(folderId) + if angular.isDefined(folder) + if not folder.opened + folder.opened = true + @_persistence.openFolder(folder.id) + + toggleFolder: (folderId) -> folder = @_folderModel.getById(folderId) @@ -103,7 +114,7 @@ ItemModel, ShowAll, _ExistsError)-> folder.error = response.msg onFailure() else - onSuccess() + onSuccess(response.data) @_persistence.createFolder folderName, 0, success |