diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-03-04 11:50:49 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-03-04 11:50:49 +0100 |
commit | 533896bd66727d90fe93bac39551f54da5a997af (patch) | |
tree | 294924352b210df35f4a7d459e6ce96d889dce94 /apps/files/js | |
parent | bcc200cf9bb18ecb385ef617488555bdcc598312 (diff) | |
parent | 3a36163e9187d7a65418350371c7b20303cae671 (diff) | |
download | nextcloud-server-533896bd66727d90fe93bac39551f54da5a997af.tar.gz nextcloud-server-533896bd66727d90fe93bac39551f54da5a997af.zip |
Merge pull request #22846 from owncloud/fileactions-downloadspinnerfix
Fix download spinner to work with CSS styles
Diffstat (limited to 'apps/files/js')
-rw-r--r-- | apps/files/js/fileactions.js | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js index 05ff2f0cbfa..69e32d500c4 100644 --- a/apps/files/js/fileactions.js +++ b/apps/files/js/fileactions.js @@ -659,19 +659,18 @@ * Replaces the download icon with a loading spinner and vice versa * - also adds the class disabled to the passed in element * - * @param downloadButtonElement download fileaction + * @param {jQuery} $downloadButtonElement download fileaction * @param {boolean} showIt whether to show the spinner(true) or to hide it(false) */ - OCA.Files.FileActions.updateFileActionSpinner = function(downloadButtonElement, showIt) { - var icon = downloadButtonElement.find('img'), - sourceImage = icon.attr('src'); - - if(showIt) { - downloadButtonElement.addClass('disabled'); - icon.attr('src', sourceImage.replace('actions/download.svg', 'loading-small.gif')); + OCA.Files.FileActions.updateFileActionSpinner = function($downloadButtonElement, showIt) { + var $icon = $downloadButtonElement.find('.icon'); + if (showIt) { + var $loadingIcon = $('<span class="icon loading"></span>'); + $icon.after($loadingIcon); + $icon.addClass('hidden'); } else { - downloadButtonElement.removeClass('disabled'); - icon.attr('src', sourceImage.replace('loading-small.gif', 'actions/download.svg')); + $downloadButtonElement.find('.loading').remove(); + $downloadButtonElement.find('.icon').removeClass('hidden'); } }; |