summaryrefslogtreecommitdiffstats
path: root/js/controller
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-11-19 15:54:32 +0100
committerBernhard Posselt <dev@bernhard-posselt.com>2014-11-19 15:54:32 +0100
commit676b8dd18742875ae07827792ed88d2b5bb3afb7 (patch)
treecd4368012b40ff6fa28cefb85e7ab49c729041ca /js/controller
parent62b6bd485009b5dbb85b50e634ea94aa177d8d42 (diff)
first stab at recommended sites
Diffstat (limited to 'js/controller')
-rw-r--r--js/controller/ContentController.js6
-rw-r--r--js/controller/ExploreController.js15
-rw-r--r--js/controller/NavigationController.js5
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 &&