From 599274f5096d04f63b95bd97b521963ef14a4ae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Calvi=C3=B1o=20S=C3=A1nchez?= Date: Fri, 9 Jun 2017 07:55:27 +0200 Subject: [PATCH] Trigger pre and post render events in MainFileInfoDetailsView MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The post-render event makes possible to modify the MainFileInfoDetailsView element once it has been rendered, which is needed by OCA.SystemTags.FilesPlugin to add the "Tags" label to the file details, while the pre-render event makes possible to detach added elements if needed before the MainFileInfoDetailsView is rendered again, as that removes the events from the child DOM elements even if they belong to other views. Signed-off-by: Daniel Calviño Sánchez --- apps/files/js/mainfileinfodetailview.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/files/js/mainfileinfodetailview.js b/apps/files/js/mainfileinfodetailview.js index 26472e0766..ea3063f617 100644 --- a/apps/files/js/mainfileinfodetailview.js +++ b/apps/files/js/mainfileinfodetailview.js @@ -171,6 +171,8 @@ * Renders this details view */ render: function() { + this.trigger('pre-render'); + if (this.model) { var isFavorite = (this.model.get('tags') || []).indexOf(OC.TAG_FAVORITE) >= 0; this.$el.html(this.template({ @@ -209,6 +211,8 @@ this.$el.empty(); } this.delegateEvents(); + + this.trigger('post-render'); } });