From 16f6c071735577453ab8c4fb24451de28828195e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Fri, 3 Aug 2018 11:47:53 +0200 Subject: [PATCH] Always call render to replace the app-sidebar if the detail view is updated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- apps/files/js/detailsview.js | 7 +++++-- apps/files/js/filelist.js | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/files/js/detailsview.js b/apps/files/js/detailsview.js index ac10b8380e..aed1736693 100644 --- a/apps/files/js/detailsview.js +++ b/apps/files/js/detailsview.js @@ -118,10 +118,13 @@ */ render: function() { // remove old instances - if ($('#app-sidebar').length === 0) { + var $appSidebar = $('#app-sidebar'); + if ($appSidebar.length === 0) { this.$el.insertAfter($('#app-content')); } else { - $('#app-sidebar').replaceWith(this.$el) + if ($appSidebar[0] !== this.el) { + $appSidebar.replaceWith(this.$el) + } } var templateVars = { diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 373aa38951..8e7c60551a 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -564,7 +564,7 @@ } this._currentFileModel = model; - + this._detailsView.render(); this._detailsView.setFileInfo(model); this._detailsView.$el.scrollTop(0); },