]> source.dussan.org Git - nextcloud-server.git/commitdiff
Cleanup and fix trashbin "clear all files" operation
authorVincent Petry <pvince81@owncloud.com>
Tue, 8 Apr 2014 14:56:12 +0000 (16:56 +0200)
committerVincent Petry <pvince81@owncloud.com>
Mon, 28 Apr 2014 12:55:01 +0000 (14:55 +0200)
apps/files/js/filelist.js
apps/files_trashbin/js/filelist.js

index 7c82ec924733c8333dbfca93779542bd4969ee9b..cf359af4aa2810176dcbf5855238733632490ac1 100644 (file)
@@ -26,7 +26,6 @@ window.FileList = {
 
        // number of files per page
        pageSize: 20,
-       totalPages: 0,
 
        /**
         * Array of files in the current folder.
@@ -358,8 +357,6 @@ window.FileList = {
                        return;
                }
 
-               this.pageNumber++;
-
                while (count > 0 && index < this.files.length) {
                        fileData = this.files[index];
                        tr = this._renderRow(fileData, {updateSummary: false});
@@ -394,8 +391,6 @@ window.FileList = {
        setFiles: function(filesArray) {
                // detach to make adding multiple rows faster
                this.files = filesArray;
-               this.pageNumber = -1;
-               this.totalPages = Math.ceil(filesArray.length / this.pageSize);
 
                this.$fileList.detach();
                this.$fileList.empty();
@@ -847,6 +842,7 @@ window.FileList = {
                if (this._selectedFiles[fileEl.data('id')]) {
                        // remove from selection first
                        this._selectFileEl(fileEl, false);
+                       this.updateSelectionSummary();
                }
                if (fileEl.data('permissions') & OC.PERMISSION_DELETE) {
                        // file is only draggable when delete permissions are set
index 42ab89ef6a6923a44eced34516ab2f41db9e5699..3bb3a92b60ddd43ca46541b3cb4ce4e221ee2a3c 100644 (file)
                                        }
                                        FileList.hideMask();
                                        // simply remove all files
-                                       FileList.update('');
+                                       FileList.setFiles([]);
                                        enableActions();
                                }
                                else {