#68 closed #155 Navigate to specific page input and close not displayed

This commit is contained in:
Eugenio Romano 2016-06-08 01:05:39 +01:00
parent f1424d1a8a
commit 5e43ec41b6
2 changed files with 13 additions and 0 deletions

View File

@ -4,6 +4,7 @@
.viewer-loader-text { .viewer-loader-text {
text-align: center; text-align: center;
color: #000;
} }
:host .page { :host .page {

View File

@ -42,6 +42,8 @@ export class ViewerComponent {
@Output() @Output()
showViewerChange: EventEmitter<boolean> = new EventEmitter<boolean>(); showViewerChange: EventEmitter<boolean> = new EventEmitter<boolean>();
otherMenu: any;
nameFile: string; nameFile: string;
currentPdfDocument: any; currentPdfDocument: any;
page: number; page: number;
@ -52,6 +54,7 @@ export class ViewerComponent {
ngOnChanges(changes) { ngOnChanges(changes) {
if (this.showViewer) { if (this.showViewer) {
this.hideOtherMenu();
if (!this.urlFile) { if (!this.urlFile) {
throw new Error('Attribute urlFile is required'); throw new Error('Attribute urlFile is required');
} }
@ -71,6 +74,9 @@ export class ViewerComponent {
* close the viewer * close the viewer
*/ */
close() { close() {
if (this.otherMenu) {
this.otherMenu.hidden = false;
}
this.showViewer = false; this.showViewer = false;
this.showViewerChange.emit(this.showViewer); this.showViewerChange.emit(this.showViewer);
} }
@ -151,4 +157,10 @@ export class ViewerComponent {
return localStorage.getItem('token'); return localStorage.getItem('token');
} }
private hideOtherMenu() {
this.otherMenu = document.querySelector("header");
if (this.otherMenu) {
this.otherMenu.hidden = true;
}
}
} }