From cd93d5c34020b1af75328c0ba22e6885c8e81878 Mon Sep 17 00:00:00 2001 From: Maxime Lalo Date: Wed, 26 Apr 2023 12:09:00 +0200 Subject: [PATCH] :bug: Carousel between files and not documents + download when validated --- .../Layouts/Folder/ViewDocuments/index.tsx | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx b/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx index bcc68904..39d10a74 100644 --- a/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx +++ b/src/front/Components/Layouts/Folder/ViewDocuments/index.tsx @@ -59,8 +59,6 @@ class ViewDocumentsClass extends BasePage { this.hasPrevious = this.hasPrevious.bind(this); this.hasNext = this.hasNext.bind(this); - - this.downloadFile = this.downloadFile.bind(this); } public override render(): JSX.Element | null { @@ -106,9 +104,9 @@ class ViewDocumentsClass extends BasePage { )} {this.props.selectedDocument?.document_status === "VALIDATED" && ( - <> - - + + + )} { }); } - private downloadFile() { - var link = document.createElement("a"); - // If you don't know the name or want to use - // the webserver default set name = '' - link.setAttribute("download", "super_nom.pdf"); - link.href = "/"; - document.body.appendChild(link); - link.click(); - link.remove(); - } - private goToPrevious() { const index = this.state.selectedFileIndex - 1; if (this.hasPrevious()) {