mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Prevent JS events from being garbage collected when a media.view.Modal is re-rendered. see #21390, #21776.
git-svn-id: https://develop.svn.wordpress.org/trunk@21771 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -101,6 +101,13 @@
|
||||
},
|
||||
|
||||
render: function() {
|
||||
// Ensure content div exists.
|
||||
this.options.$content = this.options.$content || $('<div />');
|
||||
|
||||
// Detach the content element from the DOM to prevent
|
||||
// `this.$el.html()` from garbage collecting its events.
|
||||
this.options.$content.detach();
|
||||
|
||||
this.$el.html( this.template( this.options ) );
|
||||
this.$('.media-modal-content').append( this.options.$content );
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user