Select only searched files
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
parent
625bdf0e6c
commit
5ef3499efb
|
@ -748,15 +748,24 @@
|
||||||
*/
|
*/
|
||||||
_onClickSelectAll: function(e) {
|
_onClickSelectAll: function(e) {
|
||||||
var checked = $(e.target).prop('checked');
|
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);
|
.closest('tr').toggleClass('selected', checked);
|
||||||
this._selectedFiles = {};
|
this._selectedFiles = {};
|
||||||
this._selectionSummary.clear();
|
this._selectionSummary.clear();
|
||||||
|
|
||||||
|
var selectionIds = [];
|
||||||
|
this.$fileList.find('td.selection > .selectCheckBox:checked').closest('tr').each(function() {
|
||||||
|
selectionIds.push($(this).data('id'));
|
||||||
|
});
|
||||||
|
|
||||||
if (checked) {
|
if (checked) {
|
||||||
for (var i = 0; i < this.files.length; i++) {
|
for (var i = 0; i < this.files.length; i++) {
|
||||||
var fileData = this.files[i];
|
if (selectionIds.includes(this.files[i]['id'])) {
|
||||||
this._selectedFiles[fileData.id] = fileData;
|
var fileData = this.files[i];
|
||||||
this._selectionSummary.add(fileData);
|
this._selectedFiles[fileData.id] = fileData;
|
||||||
|
this._selectionSummary.add(fileData);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.updateSelectionSummary();
|
this.updateSelectionSummary();
|
||||||
|
|
Loading…
Reference in New Issue