]> source.dussan.org Git - nextcloud-server.git/commitdiff
Properly set current file info when switching the details view
authorJulius Härtl <jus@bitgrid.net>
Wed, 8 Jan 2020 08:09:31 +0000 (09:09 +0100)
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Wed, 15 Jan 2020 10:00:07 +0000 (11:00 +0100)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
apps/files/js/filelist.js

index fd7624e452a1b5a4f7f56d12adcba8ed2de5c216..108e10f4df65a2447abc0c2cf2db5bf5a3843073 100644 (file)
                        var model = this.getModelForFile(tr)
                        var path = model.attributes.path + '/' + model.attributes.name
 
+                       // make sure the file list has the correct context available
+                       if (this._currentFileModel) {
+                               this._currentFileModel.off();
+                       }
+                       this.$fileList.children().removeClass('highlighted');
+                       tr.addClass('highlighted');
+                       this._currentFileModel = model;
+
                        // open sidebar and set file
                        OCA.Files.Sidebar.open(path.replace('//', '/'))
                },