Fix folder selection

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ (skjnldsv) 2018-06-20 22:37:59 +02:00
parent 5c555e6b4b
commit ae6bbbdfb8
No known key found for this signature in database
GPG Key ID: 60C25B8C072916CF
1 changed files with 3 additions and 2 deletions

View File

@ -756,9 +756,10 @@
for (var i = 0; i < this.files.length; i++) {
// a search will automatically hide the unwanted rows
// let's only select the matches
var fileRow = this.$fileList.find('[data-id=' + i + ']');
var fileData = this.files[i];
var fileRow = this.$fileList.find('[data-id=' + fileData.id + ']');
// do not select already selected ones
console.log(fileRow, this._selectedFiles[fileData.id]);
if (!fileRow.hasClass('hidden') && _.isUndefined(this._selectedFiles[fileData.id])) {
this._selectedFiles[fileData.id] = fileData;
this._selectionSummary.add(fileData);
@ -777,7 +778,7 @@
if (!_.isUndefined(self._selectedFiles[id])) {
// a search will automatically hide the unwanted rows
// let's only select the matches
var fileData = self.files[id];
var fileData = self._selectedFiles[id];
delete self._selectedFiles[fileData.id];
self._selectionSummary.remove(fileData);
}