Show only featured apps first on appstore listing
This commit is contained in:
@@ -363,21 +363,19 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca
|
||||
|
||||
$scope.cachedCategory = $scope.category;
|
||||
|
||||
$scope.ready = false;
|
||||
|
||||
AppStore.getAppsFast(function (error, apps) {
|
||||
if (error) return $timeout($scope.showCategory.bind(null, event), 1000);
|
||||
|
||||
if (!$scope.category) {
|
||||
$scope.apps = apps;
|
||||
} else if ($scope.category === 'featured') {
|
||||
$scope.apps = apps.filter(function (app) { return app.featured; });
|
||||
} else {
|
||||
$scope.apps = apps.filter(function (app) {
|
||||
return app.manifest.tags.some(function (tag) { return $scope.category === tag; });
|
||||
});
|
||||
}
|
||||
|
||||
$scope.ready = true;
|
||||
|
||||
document.getElementById('appstoreGrid').scrollIntoView();
|
||||
});
|
||||
};
|
||||
@@ -533,9 +531,13 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca
|
||||
fetchUsers();
|
||||
fetchGroups();
|
||||
|
||||
// start with featured apps listing
|
||||
$scope.showCategory(null, 'featured');
|
||||
|
||||
// domains is required since we populate the dropdown with domains[0]
|
||||
Client.getDomains(function (error, result) {
|
||||
if (error) console.error(error);
|
||||
|
||||
$scope.domains = result;
|
||||
|
||||
// show install app dialog immediately if an app id was passed in the query
|
||||
|
||||
Reference in New Issue
Block a user