diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-06-26 10:26:01 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-07-07 13:56:48 +0200 |
commit | 0cdb46b5c6c9e83d67f67ccd9a10fbf4577eed13 (patch) | |
tree | e94c2ff469d7ed8234f2f981207f6dbfa3179e96 /apps/files/js | |
parent | 28a51ef724518c337ecc882275afa6031a86f932 (diff) | |
download | nextcloud-server-0cdb46b5c6c9e83d67f67ccd9a10fbf4577eed13.tar.gz nextcloud-server-0cdb46b5c6c9e83d67f67ccd9a10fbf4577eed13.zip |
Fix layout of disabled links in the file list
* also disable download button after click
Diffstat (limited to 'apps/files/js')
-rw-r--r-- | apps/files/js/fileactions.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js index 9f6a77a3786..ec47534de21 100644 --- a/apps/files/js/fileactions.js +++ b/apps/files/js/fileactions.js @@ -479,11 +479,22 @@ var dir = context.dir || context.fileList.getCurrentDirectory(); var url = context.fileList.getDownloadUrl(filename, dir); - var icon = $(context.$file).find('.fileactions .action-download img'); + var downloadFileaction = $(context.$file).find('.fileactions .action-download'); + + // don't allow a second click on the download action + if(downloadFileaction.hasClass('disabled')) { + 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); if (url) { |