diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2017-06-09 07:55:27 +0200 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2017-06-09 08:43:53 +0200 |
commit | 599274f5096d04f63b95bd97b521963ef14a4ae1 (patch) | |
tree | 8917874dc1464e533c1a4e884fa5c1ecbc961076 /apps | |
parent | 0a3d9f25c14c7e9f06efdff765c26149370df382 (diff) | |
download | nextcloud-server-599274f5096d04f63b95bd97b521963ef14a4ae1.tar.gz nextcloud-server-599274f5096d04f63b95bd97b521963ef14a4ae1.zip |
Trigger pre and post render events in MainFileInfoDetailsView
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 <danxuliu@gmail.com>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/js/mainfileinfodetailview.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/files/js/mainfileinfodetailview.js b/apps/files/js/mainfileinfodetailview.js index 26472e0766d..ea3063f6176 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'); } }); |