diff --git a/src/dbp-signature-lit-element.js b/src/dbp-signature-lit-element.js index cd0bf33cd368e21eddfdd8ed3a0148bb50885c37..73e1a1f79441dcc8bc91a99bcc61efa706d077a4 100644 --- a/src/dbp-signature-lit-element.js +++ b/src/dbp-signature-lit-element.js @@ -297,7 +297,6 @@ export default class DBPSignatureLitElement extends BaseLitElement { // add annotations if (annotations.length > 0) { file = await this.addAnnotationsToFile(file, annotations); - console.log('uploadFile file', file); // Also send annotations to the server so they get included in the signature block let userText = []; @@ -380,21 +379,32 @@ export default class DBPSignatureLitElement extends BaseLitElement { } /** - * Open Filesink for multiple files + * Convert files to binary async */ - async zipDownloadClickHandler() { + async convertFiles () { let files = []; - // add all signed pdf-files - this.signedFiles.forEach((file) => { + for (const file of this.signedFiles) { const arr = utils.convertDataURIToBinary(file.contentUrl); const binaryFile = new File([arr], file.name, { type: utils.getDataURIContentType(file.contentUrl), }); files.push(binaryFile); - }); + } + return files; + } + + + /** + * Open Filesink for multiple files + */ + async zipDownloadClickHandler() { + // add all signed pdf-files + const files = await this.convertFiles(); + + this._('#file-sink').files = [...files]; this.signedFilesToDownload = files.length; - this._('#file-sink').files = files; + this._('#zip-download-button').stop(); // mark downloaded files buttons const spans = this.shadowRoot.querySelectorAll( @@ -426,7 +436,7 @@ export default class DBPSignatureLitElement extends BaseLitElement { }); files.push(binaryFile); this.signedFilesToDownload = files.length; - this._('#file-sink').files = files; + this._('#file-sink').files = [...files]; // mark downloaded files button const span = this.shadowRoot.querySelector( '#' + id + ' > div.header > span.filename > span.bold-filename' diff --git a/src/textswitch.js b/src/textswitch.js index d38693b87ce5b253467fd55fe9513e6ba2a781d0..ef6ea12001c9da73b41ef88f0e9a904bbd436f56 100644 --- a/src/textswitch.js +++ b/src/textswitch.js @@ -65,8 +65,8 @@ export class TextSwitch extends LitElement { } .active { - background-color: var(--dbp-secondary-surface) !important; - color: var(--dbp-on-secondary-surface) !important; + background-color: var(--dbp-secondary) !important; + color: var(--dbp-secondary-surface) !important; } .button {