Trevor Parscal has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/197988

Change subject: Update VE core submodule to 
10fcba6e124351115e900434e7570e48e428d882
......................................................................

Update VE core submodule to 10fcba6e124351115e900434e7570e48e428d882

New changes:
9ec087b Update OOjs to v1.1.6
aade22b Factor out ve.compareClassLists functionality
9b39fc6 Refactor expandLinearSelection test into a case loop
62308e5 Fix edge case in expandLinearSelection when selection covers node
fe4eaca Update context menu on document update
10fcba6 [BREAKING CHANGE] Emit rerender for dead nodes

Additional changes:
Use the new traverse function to bind handlers to rerender events of generated 
content nodes to update the target of async rendered reference content in 
reference context items.

Bug: T91314

Change-Id: I762a6c4c9438b431444c7af7b43043ee1517a15c
---
M lib/ve
M modules/ve-mw/ui/contextitems/ve.ui.MWReferenceContextItem.js
2 files changed, 14 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/88/197988/1

diff --git a/lib/ve b/lib/ve
index 91858b5..10fcba6 160000
--- a/lib/ve
+++ b/lib/ve
-Subproject commit 91858b53e1b973df324779eaf8a56d19e452dfec
+Subproject commit 10fcba6e124351115e900434e7570e48e428d882
diff --git a/modules/ve-mw/ui/contextitems/ve.ui.MWReferenceContextItem.js 
b/modules/ve-mw/ui/contextitems/ve.ui.MWReferenceContextItem.js
index 8c3e836..d9c144f 100644
--- a/modules/ve-mw/ui/contextitems/ve.ui.MWReferenceContextItem.js
+++ b/modules/ve-mw/ui/contextitems/ve.ui.MWReferenceContextItem.js
@@ -59,14 +59,23 @@
                view.$element.children().replaceWith( 
view.$element.children().contents() );
        }
 
-       // Make all links open in a new window
-       view.$element.find( 'a' ).attr( 'target', '_blank' );
-
        // Cleanup
        view.destroy();
 
-       // HACK: Use the $element property of the view, which will be updated 
asynchronously despite
-       // having been destroyed
+       // Make all links open in a new window (sync rendering)
+       view.$element.find( 'a' ).attr( 'target', '_blank' );
+
+       // Make all links open in a new window (async rendering)
+       ve.BranchNode.static.traverse( view, function ( node ) {
+               // Duck type ve.ce.GeneratedContentNode
+               if ( typeof node.generateContents === 'function' ) {
+                       node.once( 'rerender', function () {
+                               node.$element.find( 'a' ).attr( 'target', 
'_blank' );
+                       } );
+               }
+       } );
+
+       // WARNING: The $element property may be rendered into asynchronously
        return view.$element;
 };
 

-- 
To view, visit https://gerrit.wikimedia.org/r/197988
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I762a6c4c9438b431444c7af7b43043ee1517a15c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Trevor Parscal <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to