Browse Source

improvement in responsivness of download view

pull/192/head
Adam Dudczak 5 years ago
parent
commit
487e7ab204
2 changed files with 4 additions and 0 deletions
  1. 1
      app/server/static/js/download.pug
  2. 3
      app/server/static/js/mixin.js

1
app/server/static/js/download.pug

@ -19,4 +19,5 @@ div.columns(v-cloak="")
style="margin-top: 1em;"
type="submit"
v-on:click="download()"
v-bind:class="{'is-loading': isLoading}"
) Download

3
app/server/static/js/mixin.js

@ -254,6 +254,7 @@ export const uploadMixin = {
},
download() {
this.isLoading = true;
const headers = {};
if (this.format === 'csv') {
headers.Accept = 'text/csv; charset=utf-8';
@ -276,8 +277,10 @@ export const uploadMixin = {
link.href = url;
link.setAttribute('download', 'file.' + this.format); // or any other extension
document.body.appendChild(link);
this.isLoading = false;
link.click();
}).catch((error) => {
this.isLoading = false;
this.handleError(error);
});
},

Loading…
Cancel
Save