diff options
-rw-r--r-- | apps/files/js/filelist.js | 20 |
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; }, |