diff options
Diffstat (limited to 'js/controller')
-rw-r--r-- | js/controller/ContentController.js | 6 | ||||
-rw-r--r-- | js/controller/ExploreController.js | 15 | ||||
-rw-r--r-- | js/controller/NavigationController.js | 5 |
3 files changed, 25 insertions, 1 deletions
diff --git a/js/controller/ContentController.js b/js/controller/ContentController.js index d06d36c85..1f4971121 100644 --- a/js/controller/ContentController.js +++ b/js/controller/ContentController.js @@ -9,9 +9,13 @@ */ app.controller('ContentController', function (Publisher, FeedResource, ItemResource, SettingsResource, data, - $route, $routeParams, FEED_TYPE) { + $route, $routeParams, FEED_TYPE, $location, FolderResource) { 'use strict'; + if (FeedResource.size() === 0 && FolderResource.size() === 0) { + $location.path('/explore'); + } + // dont cache items across multiple route changes ItemResource.clear(); diff --git a/js/controller/ExploreController.js b/js/controller/ExploreController.js new file mode 100644 index 000000000..d189bfbe2 --- /dev/null +++ b/js/controller/ExploreController.js @@ -0,0 +1,15 @@ +/** + * ownCloud - News + * + * This file is licensed under the Affero General Public License version 3 or + * later. See the COPYING file. + * + * @author Bernhard Posselt <dev@bernhard-posselt.com> + * @copyright Bernhard Posselt 2014 + */ +app.controller('ExploreController', function (sites) { + 'use strict'; + + this.sites = sites.data; + +});
\ No newline at end of file diff --git a/js/controller/NavigationController.js b/js/controller/NavigationController.js index d0f9c526e..5f76eaddb 100644 --- a/js/controller/NavigationController.js +++ b/js/controller/NavigationController.js @@ -112,6 +112,11 @@ function ($route, FEED_TYPE, FeedResource, FolderResource, ItemResource, $route.current.$$route.type === FEED_TYPE.STARRED; }; + this.isExploreActive = function () { + return $route.current && + $route.current.$$route.type === FEED_TYPE.EXPLORE; + }; + this.isFolderActive = function (folderId) { return $route.current && $route.current.$$route.type === FEED_TYPE.FOLDER && |