Skip to content
Snippets Groups Projects
Commit 1f53ee75 authored by Neuber, Eugen Ramon's avatar Neuber, Eugen Ramon :speech_balloon:
Browse files

Add marking of downloaded files

See issue #38
parent 6290e112
Branches
No related tags found
No related merge requests found
......@@ -769,12 +769,12 @@ class OfficialSignaturePdfUpload extends ScopedElementsMixin(DBPSignatureLitElem
const file = this.signedFiles[id];
results.push(html`
<div class="file-block">
<div class="file-block" id="file-block-${id}">
<div class="header">
<span class="filename"><strong>${file.name}</strong> (${humanFileSize(file.contentSize)})</span>
<button class="button close"
title="${i18n.t('official-pdf-upload.download-file-button-title')}"
@click="${() => { this.downloadFileClickHandler(file); }}">
@click="${() => { this.downloadFileClickHandler(file, 'file-block-' + id); }}">
<dbp-icon name="download"></dbp-icon></button>
</div>
</div>
......
......@@ -401,13 +401,16 @@ export default class DBPSignatureLitElement extends BaseLitElement {
* Open Filesink for a single File
*
* @param file
* @param id of element to mark
*/
async downloadFileClickHandler(file) {
async downloadFileClickHandler(file, id) {
let files = [];
const arr = utils.convertDataURIToBinary(file.contentUrl);
const binaryFile = new File([arr], file.name, { type: utils.getDataURIContentType(file.contentUrl) });
files.push(binaryFile);
this.signedFilesToDownload = files.length;
this._("#file-sink").files = files;
const div = this.shadowRoot.querySelector('#' + id);
div.style.background='#c8dcc8';
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment