mirror of
https://github.com/ceph/ceph
synced 2025-01-02 09:02:34 +00:00
mgr/dashboard: Skip tab focus on "show/hide password" button
Signed-off-by: Ricardo Marques <rimarques@suse.com>
This commit is contained in:
parent
9edff075c5
commit
3cec4bd3dc
@ -8,10 +8,10 @@ export class PasswordButtonDirective implements OnInit {
|
||||
|
||||
@Input('cdPasswordButton') private cdPasswordButton: string;
|
||||
|
||||
constructor(private elementRef: ElementRef,
|
||||
private renderer: Renderer2) {}
|
||||
constructor(private elementRef: ElementRef, private renderer: Renderer2) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.renderer.setAttribute(this.elementRef.nativeElement, 'tabindex', '-1');
|
||||
this.iElement = this.renderer.createElement('i');
|
||||
this.renderer.addClass(this.iElement, 'icon-prepend');
|
||||
this.renderer.addClass(this.iElement, 'fa');
|
||||
@ -25,7 +25,7 @@ export class PasswordButtonDirective implements OnInit {
|
||||
|
||||
private update() {
|
||||
const inputElement = this.getInputElement();
|
||||
if (inputElement && (inputElement.type === 'text')) {
|
||||
if (inputElement && inputElement.type === 'text') {
|
||||
this.renderer.removeClass(this.iElement, 'fa-eye');
|
||||
this.renderer.addClass(this.iElement, 'fa-eye-slash');
|
||||
} else {
|
||||
@ -38,7 +38,7 @@ export class PasswordButtonDirective implements OnInit {
|
||||
onClick() {
|
||||
const inputElement = this.getInputElement();
|
||||
// Modify the type of the input field.
|
||||
inputElement.type = (inputElement.type === 'password') ? 'text' : 'password';
|
||||
inputElement.type = inputElement.type === 'password' ? 'text' : 'password';
|
||||
// Update the button icon/tooltip.
|
||||
this.update();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user