focus password on lock page after timeout

This commit is contained in:
Kyle Spearrin 2018-04-19 11:17:07 -04:00
parent 14fb60233a
commit 8d710456c4
2 changed files with 12 additions and 3 deletions

View File

@ -15,7 +15,7 @@
<div class="row-main">
<label for="masterPassword">{{'masterPass' | i18n}}</label>
<input id="masterPassword" type="{{showPassword ? 'text' : 'password'}}" name="MasterPassword"
class="monospaced" [(ngModel)]="masterPassword" required appAutofocus>
class="monospaced" [(ngModel)]="masterPassword" required>
</div>
<div class="action-buttons">
<a class="row-btn" href="#" appStopClick appBlurClick

View File

@ -1,4 +1,7 @@
import { Component } from '@angular/core';
import {
Component,
OnInit,
} from '@angular/core';
import { Router } from '@angular/router';
import { ToasterService } from 'angular2-toaster';
@ -16,7 +19,7 @@ import { LockComponent as BaseLockComponent } from 'jslib/angular/components/loc
selector: 'app-lock',
templateUrl: 'lock.component.html',
})
export class LockComponent extends BaseLockComponent {
export class LockComponent extends BaseLockComponent implements OnInit {
constructor(router: Router, analytics: Angulartics2,
toasterService: ToasterService, i18nService: I18nService,
platformUtilsService: PlatformUtilsService, messagingService: MessagingService,
@ -25,4 +28,10 @@ export class LockComponent extends BaseLockComponent {
messagingService, userService, cryptoService);
this.successRoute = '/tabs/current';
}
ngOnInit() {
window.setTimeout(() => {
document.getElementById('masterPassword').focus();
}, 100);
}
}