aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/js/filelist.js
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-06-29 08:52:37 +0200
committerMorris Jobke <hey@morrisjobke.de>2015-07-07 13:56:48 +0200
commit16c29021e6e4c2d879cd9d5d5d9b8f3feec61861 (patch)
tree7afa56f2f17181b0e3fa30ccab37f362eaf82f8e /apps/files/js/filelist.js
parent0cdb46b5c6c9e83d67f67ccd9a10fbf4577eed13 (diff)
downloadnextcloud-server-16c29021e6e4c2d879cd9d5d5d9b8f3feec61861.tar.gz
nextcloud-server-16c29021e6e4c2d879cd9d5d5d9b8f3feec61861.zip
Add loading spinner to multi select download button
Diffstat (limited to 'apps/files/js/filelist.js')
-rw-r--r--apps/files/js/filelist.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 417c4b9fe99..807d1a16891 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -417,6 +417,26 @@
else {
files = _.pluck(this.getSelectedFiles(), 'name');
}
+
+ var downloadFileaction = $('#selectedActionsList').find('.download');
+
+ // don't allow a second click on the download action
+ if(downloadFileaction.hasClass('disabled')) {
+ event.preventDefault();
+ return;
+ }
+
+ downloadFileaction.addClass('disabled');
+ var icon = downloadFileaction.find('img');
+ var sourceImage = icon.attr('src');
+ icon.attr('src', sourceImage.replace('actions/download.svg', 'loading-small.gif'));
+
+ // TODO proper detection of "download has started"
+ setTimeout(function(){
+ icon.attr('src', sourceImage);
+ downloadFileaction.removeClass('disabled');
+ }, 7000);
+
OC.redirect(this.getDownloadUrl(files, dir));
return false;
},