diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2020-01-15 12:32:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-15 12:32:37 +0100 |
commit | 3d03d820262cbc75e1356a58d3ef13fac45bcc8c (patch) | |
tree | 72dc56d71fe81816c3a36e1cbee6e486de605bb5 /apps/files/js/filelist.js | |
parent | cc05aa2044eb96a34c92f892a6c3901729ca153e (diff) | |
parent | 1c984645f7e9a60f1144e96e88000cad90cf76b9 (diff) | |
download | nextcloud-server-3d03d820262cbc75e1356a58d3ef13fac45bcc8c.tar.gz nextcloud-server-3d03d820262cbc75e1356a58d3ef13fac45bcc8c.zip |
Merge pull request #18732 from nextcloud/enh/files-sidebar
Sidebar polishing
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('//', '/')) + } }, /** |