dashboard: preserve apps view type in localStorage
This commit is contained in:
@@ -51,6 +51,18 @@ angular.module('Application').controller('AppsController', ['$scope', '$translat
|
||||
return item.label || item.fqdn;
|
||||
};
|
||||
|
||||
$scope.setView = function (view) {
|
||||
if (view !== 'list' && view !== 'grid') return;
|
||||
|
||||
$scope.view = view;
|
||||
localStorage.appsView = view;
|
||||
};
|
||||
|
||||
$scope.toggleView = function () {
|
||||
$scope.view = $scope.view === 'grid' ? 'list' : 'grid';
|
||||
localStorage.appsView = $scope.view;
|
||||
};
|
||||
|
||||
$scope.$watch('selectedTags', function (newVal, oldVal) {
|
||||
if (newVal === oldVal) return;
|
||||
|
||||
@@ -257,6 +269,8 @@ angular.module('Application').controller('AppsController', ['$scope', '$translat
|
||||
});
|
||||
});
|
||||
|
||||
$scope.setView(localStorage.appsView);
|
||||
|
||||
if (!$scope.user.isAtLeastAdmin) return;
|
||||
|
||||
// load local settings and apply tag filter
|
||||
|
||||
Reference in New Issue
Block a user