summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2014-04-30 14:51:02 +0200
committerMorris Jobke <hey@morrisjobke.de>2014-04-30 14:51:02 +0200
commitdca2d9311adb1ee7ce775958cec2fa94ea7756ad (patch)
treea3ee5c989dc8c4cfe2d7aedf3684f14f2c9a3525
parent09fb5331673e5b43300f59a55b09d69a0e83c620 (diff)
parent10bc67bef995bbb14e6edaa82bfd356968906f9a (diff)
downloadnextcloud-server-dca2d9311adb1ee7ce775958cec2fa94ea7756ad.tar.gz
nextcloud-server-dca2d9311adb1ee7ce775958cec2fa94ea7756ad.zip
Merge pull request #8408 from owncloud/delete-spinner
Show spinner for all files when deleting all
-rw-r--r--apps/files/js/filelist.js3
-rw-r--r--apps/files/tests/js/filelistSpec.js14
2 files changed, 17 insertions, 0 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 40ec898635e..8654cb14b36 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -1087,6 +1087,8 @@ window.FileList = {
else {
// no files passed, delete all in current dir
params.allfiles = true;
+ // show spinner for all files
+ this.$fileList.find('tr>td.date .action.delete').removeClass('delete-icon').addClass('progress-icon');
}
$.post(OC.filePath('files', 'ajax', 'delete.php'),
@@ -1106,6 +1108,7 @@ window.FileList = {
FileList.fileSummary.remove({type: fileEl.attr('data-type'), size: fileEl.attr('data-size')});
});
}
+ // TODO: this info should be returned by the ajax call!
checkTrashStatus();
FileList.updateEmptyContent();
FileList.fileSummary.update();
diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js
index eab364644cd..7a2b56d559a 100644
--- a/apps/files/tests/js/filelistSpec.js
+++ b/apps/files/tests/js/filelistSpec.js
@@ -413,6 +413,20 @@ describe('FileList tests', function() {
expect(notificationStub.notCalled).toEqual(true);
});
+ it('shows spinner on files to be deleted', function() {
+ FileList.setFiles(testFiles);
+ doDelete();
+
+ expect(FileList.findFileEl('One.txt').find('.progress-icon:not(.delete-icon)').length).toEqual(1);
+ expect(FileList.findFileEl('Three.pdf').find('.delete-icon:not(.progress-icon)').length).toEqual(1);
+ });
+ it('shows spinner on all files when deleting all', function() {
+ FileList.setFiles(testFiles);
+
+ FileList.do_delete();
+
+ expect(FileList.$fileList.find('tr .progress-icon:not(.delete-icon)').length).toEqual(4);
+ });
it('updates summary when deleting last file', function() {
FileList.setFiles([testFiles[0], testFiles[1]]);
doDelete();