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/>.
|
* 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 {
|
import {
|
||||||
MinimalNodeEntity,
|
MinimalNodeEntity,
|
||||||
MinimalNodeEntryEntity,
|
MinimalNodeEntryEntity,
|
||||||
@ -33,7 +40,10 @@ import { ContentApiService } from '@alfresco/aca-shared';
|
|||||||
import { AppExtensionService } from '../../extensions/extension.service';
|
import { AppExtensionService } from '../../extensions/extension.service';
|
||||||
import { SidebarTabRef } from '@alfresco/adf-extensions';
|
import { SidebarTabRef } from '@alfresco/adf-extensions';
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { SetInfoDrawerStateAction } from '@alfresco/aca-shared/store';
|
import {
|
||||||
|
SetInfoDrawerStateAction,
|
||||||
|
ToggleInfoDrawerAction
|
||||||
|
} from '@alfresco/aca-shared/store';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'aca-info-drawer',
|
selector: 'aca-info-drawer',
|
||||||
@ -49,6 +59,10 @@ export class InfoDrawerComponent implements OnChanges, OnInit, OnDestroy {
|
|||||||
displayNode: MinimalNodeEntryEntity | SiteEntry;
|
displayNode: MinimalNodeEntryEntity | SiteEntry;
|
||||||
tabs: Array<SidebarTabRef> = [];
|
tabs: Array<SidebarTabRef> = [];
|
||||||
|
|
||||||
|
@HostListener('keydown.escape') onEscapeKeyboardEvent() {
|
||||||
|
this.close();
|
||||||
|
}
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private store: Store<any>,
|
private store: Store<any>,
|
||||||
private contentApi: ContentApiService,
|
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) {
|
private loadNodeInfo(nodeId: string) {
|
||||||
if (nodeId) {
|
if (nodeId) {
|
||||||
this.isLoading = true;
|
this.isLoading = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user