From 6f68f42535cb84bc9e28848cfc4f72cd53f2141d Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Fri, 12 Sep 2014 00:58:47 +0200 Subject: if a feed is created, load it --- js/controller/NavigationController.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'js/controller/NavigationController.js') diff --git a/js/controller/NavigationController.js b/js/controller/NavigationController.js index 4b1cd8616..ba09f630a 100644 --- a/js/controller/NavigationController.js +++ b/js/controller/NavigationController.js @@ -9,7 +9,7 @@ */ app.controller('NavigationController', function ($route, FEED_TYPE, FeedResource, FolderResource, ItemResource, - SettingsResource, Publisher, $rootScope) { + SettingsResource, Publisher, $rootScope, $location) { 'use strict'; this.feedError = ''; @@ -126,6 +126,7 @@ function ($route, FEED_TYPE, FeedResource, FolderResource, ItemResource, FeedResource.create(feed.url, feed.folderId, undefined) .then(function (data) { Publisher.publishAll(data); + $location.path('/items/feeds/' + data.id); }); } else { // create folder first and then the feed @@ -153,7 +154,19 @@ function ($route, FEED_TYPE, FeedResource, FolderResource, ItemResource, }; this.moveFeed = function (feedId, folderId) { + var reload = false; + var feed = FeedResource.getById(feedId); + + if (this.isFolderActive(feed.folderId) || + this.isFolderActive(folderId)) { + reload = true; + } + FeedResource.move(feedId, folderId); + + if (reload) { + $route.reload(); + } }; // TBD -- cgit v1.2.3