mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
#68 add esc keypress listner
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, Input, Output } from 'angular2/core';
|
||||
import { Component, Input, Output, HostListener } from 'angular2/core';
|
||||
import { EventEmitter } from 'angular2/src/facade/async';
|
||||
|
||||
declare let PDFJS: any;
|
||||
@@ -146,6 +146,14 @@ export class ViewerComponent {
|
||||
}
|
||||
}
|
||||
|
||||
@HostListener('document:keydown', ['$event'])
|
||||
handleKeyboardEvent(event: KeyboardEvent) {
|
||||
let key = event.keyCode;
|
||||
if (key === 27) {//esc
|
||||
this.close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add Ticket to the file request
|
||||
* @returns {string}
|
||||
|
Reference in New Issue
Block a user