focus on init timeout

This commit is contained in:
Kyle Spearrin 2017-12-28 14:06:36 -05:00
parent 0fc9e70488
commit 54d22cadd0
1 changed files with 4 additions and 6 deletions

View File

@ -24,12 +24,6 @@ export class CurrentController {
this.inSidebar = utilsService.inSidebar($window);
this.disableSearch = utilsService.isEdge();
$scope.$on('$viewContentLoaded', function () {
$timeout(function () {
document.getElementById('search').focus();
}, 50);
});
$scope.$on('syncCompleted', (event: any, successfully: boolean) => {
if (this.loaded) {
$timeout(this.loadVault.bind(this), 500);
@ -42,6 +36,10 @@ export class CurrentController {
}
$onInit() {
this.$timeout(function () {
document.getElementById('search').focus();
}, 50);
this.loadVault();
}