diff options
Diffstat (limited to 'apps/files/js/filelist.js')
-rw-r--r-- | apps/files/js/filelist.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index fd7624e452a..821a11804b4 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -630,7 +630,7 @@ * @param {string|OCA.Files.FileInfoModel} fileName file name from the current list or a FileInfoModel object * @param {boolean} [show=true] whether to open the sidebar if it was closed */ - _updateDetailsView: function(fileName) { + _updateDetailsView: function(fileName, show) { if (!(OCA.Files && OCA.Files.Sidebar)) { console.error('No sidebar available'); return; @@ -650,8 +650,18 @@ 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('//', '/')) + if (typeof show === 'undefined' || !!show || (OCA.Files.Sidebar.file !== '')) { + OCA.Files.Sidebar.open(path.replace('//', '/')) + } }, /** |