mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-06-30 18:15:11 +00:00
[ADF-4198] - fix user info close on esc key (#4644)
This commit is contained in:
parent
b371929170
commit
c9977c58fa
@ -1,4 +1,4 @@
|
|||||||
<div id="userinfo_container" [class.adf-userinfo-name-right]="showOnRight()"
|
<div id="userinfo_container" [class.adf-userinfo-name-right]="showOnRight()" (keyup)="onKeyPress($event)"
|
||||||
class="adf-userinfo-container" *ngIf="isLoggedIn()">
|
class="adf-userinfo-container" *ngIf="isLoggedIn()">
|
||||||
|
|
||||||
<ng-container *ngIf="showName">
|
<ng-container *ngIf="showName">
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Component, Input, OnInit, ViewEncapsulation } from '@angular/core';
|
import { Component, Input, OnInit, ViewEncapsulation, ViewChild } from '@angular/core';
|
||||||
import { AuthenticationService } from '../../services/authentication.service';
|
import { AuthenticationService } from '../../services/authentication.service';
|
||||||
import { BpmUserModel } from './../models/bpm-user.model';
|
import { BpmUserModel } from './../models/bpm-user.model';
|
||||||
import { EcmUserModel } from './../models/ecm-user.model';
|
import { EcmUserModel } from './../models/ecm-user.model';
|
||||||
@ -24,6 +24,7 @@ import { BpmUserService } from './../services/bpm-user.service';
|
|||||||
import { EcmUserService } from './../services/ecm-user.service';
|
import { EcmUserService } from './../services/ecm-user.service';
|
||||||
import { IdentityUserService } from '../services/identity-user.service';
|
import { IdentityUserService } from '../services/identity-user.service';
|
||||||
import { of, Observable } from 'rxjs';
|
import { of, Observable } from 'rxjs';
|
||||||
|
import { MatMenuTrigger } from '@angular/material';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'adf-userinfo',
|
selector: 'adf-userinfo',
|
||||||
@ -33,6 +34,8 @@ import { of, Observable } from 'rxjs';
|
|||||||
})
|
})
|
||||||
export class UserInfoComponent implements OnInit {
|
export class UserInfoComponent implements OnInit {
|
||||||
|
|
||||||
|
@ViewChild(MatMenuTrigger) trigger: MatMenuTrigger;
|
||||||
|
|
||||||
/** Custom path for the background banner image for ACS users. */
|
/** Custom path for the background banner image for ACS users. */
|
||||||
@Input()
|
@Input()
|
||||||
ecmBackgroundImage: string = './assets/images/ecm-background.png';
|
ecmBackgroundImage: string = './assets/images/ecm-background.png';
|
||||||
@ -87,6 +90,16 @@ export class UserInfoComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onKeyPress(event: KeyboardEvent) {
|
||||||
|
this.closeUserModal(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
private closeUserModal($event: KeyboardEvent) {
|
||||||
|
if ($event.keyCode === 27 ) {
|
||||||
|
this.trigger.closeMenu();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
isLoggedIn(): boolean {
|
isLoggedIn(): boolean {
|
||||||
return this.authService.isLoggedIn();
|
return this.authService.isLoggedIn();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user