From ad90ba27cdcdcd60e04ee0b781c6698124e900fa Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Wed, 15 Jul 2015 17:35:35 +0200 Subject: Styling fixes + hightlight in files sidebar Sidebar scrolls with contents Highlight currently show file --- apps/files/js/detailsview.js | 1 + apps/files/js/filelist.js | 7 +++++++ 2 files changed, 8 insertions(+) (limited to 'apps/files/js') diff --git a/apps/files/js/detailsview.js b/apps/files/js/detailsview.js index d69d8c09c16..feced7e34dd 100644 --- a/apps/files/js/detailsview.js +++ b/apps/files/js/detailsview.js @@ -153,6 +153,7 @@ setFileInfo: function(fileInfo) { this._fileInfo = fileInfo; + // FIXME: this will render panels twice this.render(); // notify all panels diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 9f0d48ff011..5c7fcb6b998 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -286,12 +286,19 @@ */ _updateDetailsView: function(fileInfo) { var self = this; + var oldFileInfo = this._detailsView.getFileInfo(); + if (oldFileInfo) { + // TODO: use more efficient way, maybe track the highlight + this.$fileList.children().filterAttr('data-id', '' + oldFileInfo.id).removeClass('highlighted'); + } + if (!fileInfo) { this._detailsView.$el.addClass('disappear'); this._detailsView.setFileInfo(null); return; } + this.$fileList.children().filterAttr('data-id', '' + fileInfo.id).addClass('highlighted'); this._detailsView.setFileInfo(_.extend({ path: this.getCurrentDirectory() }, fileInfo)); -- cgit v1.2.3