dashboard: grid view is the default

This commit is contained in:
Johannes Zellner
2024-04-29 09:32:00 +02:00
parent 7eda1136ea
commit d2ae6c2353
2 changed files with 12 additions and 6 deletions

View File

@@ -31,7 +31,13 @@ angular.module('Application').controller('AppsController', ['$scope', '$translat
$scope.APP_TYPES = APP_TYPES;
$scope.showFilter = false;
$scope.filterActive = false;
$scope.view = 'list';
$scope.VIEWS = {
GRID: 'grid',
LIST: 'list'
};
$scope.view = $scope.VIEWS.GRID;
$scope.orderBy = 'location'; // or app, status, sso
$scope.orderByReverse = false;
@@ -70,14 +76,14 @@ angular.module('Application').controller('AppsController', ['$scope', '$translat
};
$scope.setView = function (view) {
if (view !== 'list' && view !== 'grid') return;
if (view !== $scope.VIEWS.LIST && view !== $scope.VIEWS.GRID) return;
$scope.view = view;
localStorage.appsView = view;
};
$scope.toggleView = function () {
$scope.view = $scope.view === 'grid' ? 'list' : 'grid';
$scope.view = $scope.view === $scope.VIEWS.GRID ? $scope.VIEWS.LIST : $scope.VIEWS.GRID;
localStorage.appsView = $scope.view;
};