From 01ffc68fc237552d12ea2ee985bed43eab06f88c Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 19 Dec 2017 11:30:52 -0500 Subject: [PATCH] focus vault search on `$viewContentLoaded` --- src/app/organization/organizationVaultController.js | 2 +- src/app/vault/vaultController.js | 2 ++ src/app/views/userLayout.html | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/organization/organizationVaultController.js b/src/app/organization/organizationVaultController.js index 87ee00befb..f953337837 100644 --- a/src/app/organization/organizationVaultController.js +++ b/src/app/organization/organizationVaultController.js @@ -47,11 +47,11 @@ $q.all([collectionPromise, cipherPromise]).then(function () { $scope.loading = false; + $("#search").focus(); if ($state.params.search) { $uibModalStack.dismissAll(); $scope.$emit('setSearchVaultText', $state.params.search); - $('#search').focus(); } if ($state.params.viewEvents) { diff --git a/src/app/vault/vaultController.js b/src/app/vault/vaultController.js index c23e2fdf2c..d41c9b72ce 100644 --- a/src/app/vault/vaultController.js +++ b/src/app/vault/vaultController.js @@ -18,6 +18,8 @@ } $scope.$on('$viewContentLoaded', function () { + $("#search").focus(); + if ($rootScope.vaultGroupings && $rootScope.vaultCiphers) { $scope.loading = false; loadGroupingData($rootScope.vaultGroupings); diff --git a/src/app/views/userLayout.html b/src/app/views/userLayout.html index 36388ff2b0..c1b1f6fb25 100644 --- a/src/app/views/userLayout.html +++ b/src/app/views/userLayout.html @@ -36,7 +36,7 @@
+ ng-focus="searchVault()" ng-model="main.searchVaultText" />