From ae6bbbdfb8ccd773badaa81d9665a7855fef517a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Wed, 20 Jun 2018 22:37:59 +0200 Subject: [PATCH] Fix folder selection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- apps/files/js/filelist.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 0e525f6c7e3..59655dcd8b5 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -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); }