diff --git a/src/app/config.js b/src/app/config.js index be5970d556..6382f42a0a 100644 --- a/src/app/config.js +++ b/src/app/config.js @@ -7,7 +7,7 @@ angular $locationProvider.hashPrefix(''); jwtOptionsProvider.config({ urlParam: 'access_token3', - whiteListedDomains: ['api.bitwarden.com', 'preview-api.bitwarden.com', 'localhost', '192.168.1.8'] + whiteListedDomains: ['api.bitwarden.com', 'preview-api.bitwarden.com', 'localhost', '192.168.1.6'] }); var refreshPromise; jwtInterceptorProvider.tokenGetter = /*@ngInject*/ function (options, tokenService, authService) { @@ -77,7 +77,10 @@ angular url: '^/vault', templateUrl: 'app/vault/views/vault.html', controller: 'vaultController', - data: { pageTitle: 'My Vault' }, + data: { + pageTitle: 'My Vault', + controlSidebar: true + }, params: { refreshFromServer: false } diff --git a/src/app/global/mainController.js b/src/app/global/mainController.js index 33cf89d6f0..db6a15677f 100644 --- a/src/app/global/mainController.js +++ b/src/app/global/mainController.js @@ -4,6 +4,7 @@ angular .controller('mainController', function ($scope, $state, authService, appSettings, toastr, $window, $document) { var vm = this; vm.bodyClass = ''; + vm.usingControlSidebar = vm.openControlSidebar = false; vm.searchVaultText = null; vm.version = appSettings.version; @@ -24,7 +25,17 @@ angular $.AdminLTE.pushMenu.expandOnHover(); } - $(document).off('click', '.sidebar li a'); + $document.off('click', '.sidebar li a'); + + $('#control-sidebar').on('click', function (e) { + e.preventDefault(); + var bod = $('body'); + if (!bod.hasClass('control-sidebar-open')) { + bod.addClass('control-sidebar-open'); + } else { + bod.removeClass('control-sidebar-open'); + } + }); } }); @@ -38,6 +49,9 @@ angular else { vm.bodyClass = ''; } + + vm.usingControlSidebar = !!toState.data.controlSidebar; + vm.openControlSidebar = vm.usingControlSidebar && $document.width() > 768; }); $scope.addLogin = function () { diff --git a/src/app/vault/vaultController.js b/src/app/vault/vaultController.js index 8b3a45784c..87d8321fa7 100644 --- a/src/app/vault/vaultController.js +++ b/src/app/vault/vaultController.js @@ -6,6 +6,7 @@ $scope.loading = true; $scope.logins = []; $scope.favoriteCollapsed = $localStorage.collapsedFolders && 'favorite' in $localStorage.collapsedFolders; + $scope.folderIdFilter = undefined; if ($state.params.refreshFromServer) { $rootScope.vaultFolders = $rootScope.vaultLogins = null; @@ -281,6 +282,18 @@ }); }; + $scope.filterFolder = function (folder) { + $scope.folderIdFilter = folder.id; + }; + + $scope.clearFilters = function () { + $scope.folderIdFilter = undefined; + }; + + $scope.folderFilter = function (folder) { + return $scope.folderIdFilter === undefined || folder.id === $scope.folderIdFilter; + } + function removeLoginFromScopes(login) { var index = $rootScope.vaultLogins.indexOf(login); if (index > -1) { diff --git a/src/app/vault/views/vault.html b/src/app/vault/views/vault.html index 403a38fc15..c9a8085f99 100644 --- a/src/app/vault/views/vault.html +++ b/src/app/vault/views/vault.html @@ -14,7 +14,7 @@
Loading...