diff --git a/app/server/static/js/download.pug b/app/server/static/js/download.pug index 9138f921..122c5ec0 100644 --- a/app/server/static/js/download.pug +++ b/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 diff --git a/app/server/static/js/mixin.js b/app/server/static/js/mixin.js index 2e1dfedb..ee82cead 100644 --- a/app/server/static/js/mixin.js +++ b/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); }); },