Merge "Disable VisualEditor page takeovers while a reply widget is open"

This commit is contained in:
jenkins-bot 2020-05-08 14:24:26 +00:00 committed by Gerrit Code Review
commit 4c8e92e0fb

View file

@ -131,6 +131,10 @@ CommentController.prototype.setup = function () {
$( '.dt-init-replylink-reply' ).attr( {
tabindex: '-1'
} );
// Suppress page takeover behavior for VE editing so that our unload
// handler can warn of data loss.
// eslint-disable-next-line no-jquery/no-global-selector
$( '#ca-edit, #ca-ve-edit, .mw-editsection a, #ca-addsection' ).off( '.ve-target' );
logger( {
action: 'init',
@ -230,6 +234,11 @@ CommentController.prototype.teardown = function () {
$( '.dt-init-replylink-reply' ).attr( {
tabindex: '0'
} );
// We deliberately mangled edit links earlier so VE can't steal our page;
// have it redo setup to fix those.
if ( mw.libs.ve && mw.libs.ve.setupEditLinks ) {
mw.libs.ve.setupEditLinks();
}
modifier.removeListItem( this.newListItem );
this.newListItem = null;
this.$replyLink.trigger( 'focus' );