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>
This commit is contained in:
parent
706106408c
commit
2384703cf6
|
@ -150,6 +150,8 @@
|
||||||
* Renders this details view
|
* Renders this details view
|
||||||
*/
|
*/
|
||||||
render: function() {
|
render: function() {
|
||||||
|
this.trigger('pre-render');
|
||||||
|
|
||||||
if (this.model) {
|
if (this.model) {
|
||||||
var isFavorite = (this.model.get('tags') || []).indexOf(OC.TAG_FAVORITE) >= 0;
|
var isFavorite = (this.model.get('tags') || []).indexOf(OC.TAG_FAVORITE) >= 0;
|
||||||
this.$el.html(this.template({
|
this.$el.html(this.template({
|
||||||
|
@ -188,6 +190,8 @@
|
||||||
this.$el.empty();
|
this.$el.empty();
|
||||||
}
|
}
|
||||||
this.delegateEvents();
|
this.delegateEvents();
|
||||||
|
|
||||||
|
this.trigger('post-render');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue