summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-06-20 01:15:22 +0200
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-06-20 01:15:22 +0200
commit5ef3499efb677522dcb3c398c9f38f361659c0b6 (patch)
tree5e1e6e27a82273259df80f0bd9b3217e6fb0f626 /apps
parent625bdf0e6c6e3ebcde102f22cf54cbd505d6faa8 (diff)
downloadnextcloud-server-5ef3499efb677522dcb3c398c9f38f361659c0b6.tar.gz
nextcloud-server-5ef3499efb677522dcb3c398c9f38f361659c0b6.zip
Select only searched files
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps')
-rw-r--r--apps/files/js/filelist.js17
1 files changed, 13 insertions, 4 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index c420e7212a0..950e595c170 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -748,15 +748,24 @@
*/
_onClickSelectAll: function(e) {
var checked = $(e.target).prop('checked');
- this.$fileList.find('td.selection>.selectCheckBox').prop('checked', checked)
+ // Select only visible checkboxes to filter out unmatched file in search
+ this.$fileList.find('td.selection > .selectCheckBox:visible').prop('checked', checked)
.closest('tr').toggleClass('selected', checked);
this._selectedFiles = {};
this._selectionSummary.clear();
+
+ var selectionIds = [];
+ this.$fileList.find('td.selection > .selectCheckBox:checked').closest('tr').each(function() {
+ selectionIds.push($(this).data('id'));
+ });
+
if (checked) {
for (var i = 0; i < this.files.length; i++) {
- var fileData = this.files[i];
- this._selectedFiles[fileData.id] = fileData;
- this._selectionSummary.add(fileData);
+ if (selectionIds.includes(this.files[i]['id'])) {
+ var fileData = this.files[i];
+ this._selectedFiles[fileData.id] = fileData;
+ this._selectionSummary.add(fileData);
+ }
}
}
this.updateSelectionSummary();