summaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-01-26 16:13:10 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-01-26 16:13:10 +0100
commit22010517f5e404dbc67abed911d8b47d17b86e6d (patch)
treeb7fff03bb00cd23c1eb475de297500d51fed0318 /apps/files
parent022ac12ab495e589d3a1bf989ee38c3e5c4d39c2 (diff)
parentdf7db3685ebc4d188d604e1ccf94c4ecf0f2d5b1 (diff)
downloadnextcloud-server-22010517f5e404dbc67abed911d8b47d17b86e6d.tar.gz
nextcloud-server-22010517f5e404dbc67abed911d8b47d17b86e6d.zip
Merge pull request #21752 from owncloud/files-delete-fix
Only check selection for delete permissions, not parent folder
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/js/filelist.js4
-rw-r--r--apps/files/tests/js/filelistSpec.js10
2 files changed, 1 insertions, 13 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index d0c7687e5b6..35999b5d0ee 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -2305,7 +2305,6 @@
*/
updateSelectionSummary: function() {
var summary = this._selectionSummary.summary;
- var canDelete;
var selection;
if (summary.totalFiles === 0 && summary.totalDirs === 0) {
@@ -2316,7 +2315,6 @@
this.$el.find('.selectedActions').addClass('hidden');
}
else {
- canDelete = (this.getDirectoryPermissions() & OC.PERMISSION_DELETE) && this.isSelectedDeletable();
this.$el.find('.selectedActions').removeClass('hidden');
this.$el.find('#headerSize a>span:first').text(OC.Util.humanFileSize(summary.totalSize));
@@ -2338,7 +2336,7 @@
this.$el.find('#headerName a.name>span:first').text(selection);
this.$el.find('#modified a>span:first').text('');
this.$el.find('table').addClass('multiselect');
- this.$el.find('.delete-selected').toggleClass('hidden', !canDelete);
+ this.$el.find('.delete-selected').toggleClass('hidden', !this.isSelectedDeletable());
}
},
diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js
index 9cd6bc90e88..1b2dd12213b 100644
--- a/apps/files/tests/js/filelistSpec.js
+++ b/apps/files/tests/js/filelistSpec.js
@@ -1705,16 +1705,6 @@ describe('OCA.Files.FileList tests', function() {
});
});
describe('Selection overlay', function() {
- it('show delete action according to directory permissions', function() {
- fileList.setFiles(testFiles);
- $('#permissions').val(OC.PERMISSION_READ | OC.PERMISSION_DELETE);
- $('.select-all').click();
- expect(fileList.$el.find('.delete-selected').hasClass('hidden')).toEqual(false);
- $('.select-all').click();
- $('#permissions').val(OC.PERMISSION_READ);
- $('.select-all').click();
- expect(fileList.$el.find('.delete-selected').hasClass('hidden')).toEqual(true);
- });
it('show doesnt show the delete action if one or more files are not deletable', function () {
fileList.setFiles(testFiles);
$('#permissions').val(OC.PERMISSION_READ | OC.PERMISSION_DELETE);