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:
@@ -18,6 +18,19 @@
|
||||
float: left;
|
||||
}
|
||||
|
||||
#loader{
|
||||
margin: auto;
|
||||
padding-top: 20px;
|
||||
width:300px;
|
||||
}
|
||||
#loader-text{
|
||||
width:300px;
|
||||
white-space: nowrap;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
#viewer-toolbar-pagination {
|
||||
margin-left: 25%;
|
||||
}
|
||||
@@ -67,3 +80,4 @@
|
||||
:host .canvasWrapper {
|
||||
box-shadow: 0px 0px 8px 2px #000;
|
||||
}
|
||||
|
||||
|
@@ -3,7 +3,7 @@
|
||||
<div id="viewer-shadow-transparent" class="viewer-shadow-transparent"></div>
|
||||
</div>
|
||||
|
||||
<div id="viewer-main-container" class="viewer-main-container" [ngClass]="{'viewer-overlay-view': overlayMode }">
|
||||
<div id="viewer-main-container" class="viewer-main-container" [ngClass]="{'viewer-overlay-view': overlayMode }" (keypress)=eventHandler() >
|
||||
|
||||
<!-- Start Layout -->
|
||||
<div mdl class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
|
||||
@@ -60,7 +60,14 @@
|
||||
|
||||
<!-- Start Pdf Canvas -->
|
||||
<div id="viewer-pdf-container" class="viewer-pdf-container">
|
||||
<div id="viewer-viewerPdf" style="border:1px solid black;"></div>
|
||||
<div id="viewer-viewerPdf" style="border:1px solid black;">
|
||||
<div id="loader">
|
||||
<div>
|
||||
<div id="loader-spin" class="mdl-progress mdl-js-progress mdl-progress__indeterminate"></div>
|
||||
</div>
|
||||
<div id="loader-text">Loading...</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Pdf Canvas -->
|
||||
|
||||
|
@@ -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