diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-07-22 10:35:15 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-07-22 10:35:15 +0200 |
commit | 009d1f3214f76cf1ae2318504449110104e159fb (patch) | |
tree | a363f595ab4a908f713199df02af24bf363317e9 | |
parent | 43afa4c0e352fd5bbc46956b7ee62078ff5b6e45 (diff) | |
download | nextcloud-server-009d1f3214f76cf1ae2318504449110104e159fb.tar.gz nextcloud-server-009d1f3214f76cf1ae2318504449110104e159fb.zip |
move updateFileActionSpinner to OCA.Files.FileActions
-rw-r--r-- | apps/files/js/fileactions.js | 24 | ||||
-rw-r--r-- | apps/files/js/filelist.js | 4 | ||||
-rw-r--r-- | apps/files/js/files.js | 20 |
3 files changed, 24 insertions, 24 deletions
diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js index 6b8913e40c1..8dd26d71c3e 100644 --- a/apps/files/js/fileactions.js +++ b/apps/files/js/fileactions.js @@ -488,10 +488,10 @@ if (url) { var disableLoadingState = function(){ - OCA.Files.Files.updateFileActionSpinner(downloadFileaction, false); + OCA.Files.FileActions.updateFileActionSpinner(downloadFileaction, false); }; - OCA.Files.Files.updateFileActionSpinner(downloadFileaction, true); + OCA.Files.FileActions.updateFileActionSpinner(downloadFileaction, true); OCA.Files.Files.handleDownload(url, disableLoadingState); } }, t('files', 'Download')); @@ -501,6 +501,26 @@ OCA.Files.FileActions = FileActions; /** + * 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 {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')); + } else { + downloadButtonElement.removeClass('disabled'); + icon.attr('src', sourceImage.replace('loading-small.gif', 'actions/download.svg')); + } + }; + + /** * File action attributes. * * @todo make this a real class in the future diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 2bc9233ba69..7a09d85ac41 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -427,10 +427,10 @@ } var disableLoadingState = function(){ - OCA.Files.Files.updateFileActionSpinner(downloadFileaction, false); + OCA.Files.FileActions.updateFileActionSpinner(downloadFileaction, false); }; - OCA.Files.Files.updateFileActionSpinner(downloadFileaction, true); + OCA.Files.FileActions.updateFileActionSpinner(downloadFileaction, true); OCA.Files.Files.handleDownload(this.getDownloadUrl(files, dir), disableLoadingState); return false; }, diff --git a/apps/files/js/files.js b/apps/files/js/files.js index 3b7c892f5eb..5e9ec53fc9d 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -301,26 +301,6 @@ OC.redirect(url + '&downloadStartSecret=' + randomToken); OC.Util.waitFor(checkForDownloadCookie, 500); - }, - - /** - * 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 {boolean} showIt whether to show the spinner(true) or to hide it(false) - */ - 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')); - } else { - downloadButtonElement.removeClass('disabled'); - icon.attr('src', sourceImage.replace('loading-small.gif', 'actions/download.svg')); - } } }; |