mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-06-16 17:54:45 +00:00
close panel on Esc keyboard event
This commit is contained in:
parent
195284c13a
commit
88e6f98ed2
@ -23,7 +23,14 @@
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { Component, Input, OnChanges, OnInit, OnDestroy } from '@angular/core';
|
||||
import {
|
||||
Component,
|
||||
HostListener,
|
||||
Input,
|
||||
OnChanges,
|
||||
OnInit,
|
||||
OnDestroy
|
||||
} from '@angular/core';
|
||||
import {
|
||||
MinimalNodeEntity,
|
||||
MinimalNodeEntryEntity,
|
||||
@ -33,7 +40,10 @@ import { ContentApiService } from '@alfresco/aca-shared';
|
||||
import { AppExtensionService } from '../../extensions/extension.service';
|
||||
import { SidebarTabRef } from '@alfresco/adf-extensions';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { SetInfoDrawerStateAction } from '@alfresco/aca-shared/store';
|
||||
import {
|
||||
SetInfoDrawerStateAction,
|
||||
ToggleInfoDrawerAction
|
||||
} from '@alfresco/aca-shared/store';
|
||||
|
||||
@Component({
|
||||
selector: 'aca-info-drawer',
|
||||
@ -49,6 +59,10 @@ export class InfoDrawerComponent implements OnChanges, OnInit, OnDestroy {
|
||||
displayNode: MinimalNodeEntryEntity | SiteEntry;
|
||||
tabs: Array<SidebarTabRef> = [];
|
||||
|
||||
@HostListener('keydown.escape') onEscapeKeyboardEvent() {
|
||||
this.close();
|
||||
}
|
||||
|
||||
constructor(
|
||||
private store: Store<any>,
|
||||
private contentApi: ContentApiService,
|
||||
@ -80,6 +94,10 @@ export class InfoDrawerComponent implements OnChanges, OnInit, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
private close() {
|
||||
this.store.dispatch(new ToggleInfoDrawerAction());
|
||||
}
|
||||
|
||||
private loadNodeInfo(nodeId: string) {
|
||||
if (nodeId) {
|
||||
this.isLoading = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user