1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 08:43:33 +00:00

filter cipher list by type

This commit is contained in:
Kyle Spearrin
2017-10-07 21:48:02 -04:00
parent 52f4a9d961
commit 4046339569
2 changed files with 49 additions and 3 deletions

View File

@@ -2,11 +2,13 @@
.module('bit.vault')
.controller('vaultController', function ($scope, $uibModal, apiService, $filter, cryptoService, authService, toastr,
cipherService, $q, $localStorage, $timeout, $rootScope, $state, $analytics) {
cipherService, $q, $localStorage, $timeout, $rootScope, $state, $analytics, constants) {
$scope.loading = true;
$scope.ciphers = [];
$scope.constants = constants;
$scope.favoriteCollapsed = $localStorage.collapsedFolders && 'favorite' in $localStorage.collapsedFolders;
$scope.folderIdFilter = undefined;
$scope.typeFilter = undefined;
if ($state.params.refreshFromServer) {
$rootScope.vaultFolders = $rootScope.vaultCiphers = null;
@@ -347,8 +349,19 @@
}
};
$scope.filterType = function (type) {
$scope.typeFilter = type;
if ($.AdminLTE && $.AdminLTE.layout) {
$timeout(function () {
$.AdminLTE.layout.fix();
}, 0);
}
};
$scope.clearFilters = function () {
$scope.folderIdFilter = undefined;
$scope.typeFilter = undefined;
if ($.AdminLTE && $.AdminLTE.layout) {
$timeout(function () {
@@ -361,6 +374,10 @@
return $scope.folderIdFilter === undefined || folder.id === $scope.folderIdFilter;
};
$scope.cipherFilter = function (cipher) {
return $scope.typeFilter === undefined || cipher.type === $scope.typeFilter;
};
$scope.unselectAll = function () {
selectAll(false);
};