From 487e7ab204eb21400719b26f786e45d542ef7c41 Mon Sep 17 00:00:00 2001 From: Adam Dudczak Date: Sun, 12 May 2019 14:18:29 +0200 Subject: [PATCH] improvement in responsivness of download view --- app/server/static/js/download.pug | 1 + app/server/static/js/mixin.js | 3 +++ 2 files changed, 4 insertions(+) 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); }); },