From 9f660f9db883734e09d30fa7b50d047174d6d94b Mon Sep 17 00:00:00 2001 From: Trevor Parscal Date: Wed, 18 Mar 2015 16:22:02 -0700 Subject: [PATCH] Restore async rendering of ReferenceContextItem We moved toward serialization, but in the case where we don't have a rendering yet and it's happening async, we need to use the same DOM container that will be rendered into. Bug: T91336 Change-Id: I53920591fde02175d4162b1fe5899b97b10a5b0f --- .../ve-mw/ui/contextitems/ve.ui.MWReferenceContextItem.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/ve-mw/ui/contextitems/ve.ui.MWReferenceContextItem.js b/modules/ve-mw/ui/contextitems/ve.ui.MWReferenceContextItem.js index 75aa3a26fe..8c3e8361c5 100644 --- a/modules/ve-mw/ui/contextitems/ve.ui.MWReferenceContextItem.js +++ b/modules/ve-mw/ui/contextitems/ve.ui.MWReferenceContextItem.js @@ -62,10 +62,12 @@ ve.ui.MWReferenceContextItem.prototype.getRendering = function () { // Make all links open in a new window view.$element.find( 'a' ).attr( 'target', '_blank' ); + // Cleanup view.destroy(); - // Strip the HTML rendering of any events that might be still bound to it - return $( view.$element.html() ); + // HACK: Use the $element property of the view, which will be updated asynchronously despite + // having been destroyed + return view.$element; }; /**