Skip to content
Snippets Groups Projects
Commit 13eefeeb authored by Alex ORLUC's avatar Alex ORLUC
Browse files

fix initDoc vars

parent e49ca7f5
No related branches found
No related tags found
No related merge requests found
......@@ -128,12 +128,7 @@ export class DocumentComponent implements OnInit {
this.loadingDoc = true;
this.http.get('../rest/documents/' + params['id'])
.subscribe((data: any) => {
this.docList = [];
this.signaturesService.signaturesContent = [];
this.signaturesService.notesContent = [];
this.signaturesService.currentAction = 0;
this.signaturesService.currentPage = 1;
this.signaturesContent.currentDoc = 1;
this.initDoc();
this.mainDocument = data.document;
this.signaturesService.mainDocumentId = this.mainDocument.id;
this.actionsList = data.document.actionsAllowed;
......@@ -149,6 +144,7 @@ export class DocumentComponent implements OnInit {
this.docList.push({ 'id': attach.id, 'encodedDocument': '', 'title': '' });
});
this.loadingDoc = false;
this.pdfRender(this.docList[this.currentDoc]);
setTimeout(() => {
this.loadingPage = false;
......@@ -165,6 +161,17 @@ export class DocumentComponent implements OnInit {
});
}
initDoc() {
this.docList = [];
this.signaturesService.signaturesContent = [];
this.signaturesService.notesContent = [];
this.signaturesService.currentAction = 0;
this.signaturesService.currentPage = 1;
this.pageNum = 1;
this.signaturesContent.currentDoc = 1;
this.currentDoc = 0;
}
pdfRender(document: any) {
const binary_string = window.atob(document.encodedDocument);
const len = binary_string.length;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment