Browse Source

Cleanup and fix trashbin "clear all files" operation

tags/v7.0.0alpha2
Vincent Petry 10 years ago
parent
commit
3c006a5a4d
2 changed files with 2 additions and 6 deletions
  1. 1
    5
      apps/files/js/filelist.js
  2. 1
    1
      apps/files_trashbin/js/filelist.js

+ 1
- 5
apps/files/js/filelist.js View File



// number of files per page // number of files per page
pageSize: 20, pageSize: 20,
totalPages: 0,


/** /**
* Array of files in the current folder. * Array of files in the current folder.
return; return;
} }


this.pageNumber++;

while (count > 0 && index < this.files.length) { while (count > 0 && index < this.files.length) {
fileData = this.files[index]; fileData = this.files[index];
tr = this._renderRow(fileData, {updateSummary: false}); tr = this._renderRow(fileData, {updateSummary: false});
setFiles: function(filesArray) { setFiles: function(filesArray) {
// detach to make adding multiple rows faster // detach to make adding multiple rows faster
this.files = filesArray; this.files = filesArray;
this.pageNumber = -1;
this.totalPages = Math.ceil(filesArray.length / this.pageSize);


this.$fileList.detach(); this.$fileList.detach();
this.$fileList.empty(); this.$fileList.empty();
if (this._selectedFiles[fileEl.data('id')]) { if (this._selectedFiles[fileEl.data('id')]) {
// remove from selection first // remove from selection first
this._selectFileEl(fileEl, false); this._selectFileEl(fileEl, false);
this.updateSelectionSummary();
} }
if (fileEl.data('permissions') & OC.PERMISSION_DELETE) { if (fileEl.data('permissions') & OC.PERMISSION_DELETE) {
// file is only draggable when delete permissions are set // file is only draggable when delete permissions are set

+ 1
- 1
apps/files_trashbin/js/filelist.js View File

} }
FileList.hideMask(); FileList.hideMask();
// simply remove all files // simply remove all files
FileList.update('');
FileList.setFiles([]);
enableActions(); enableActions();
} }
else { else {

Loading…
Cancel
Save