Prtksxna has uploaded a new change for review. https://gerrit.wikimedia.org/r/183008
Change subject: Disable Navigation Popups on render rather than document load ...................................................................... Disable Navigation Popups on render rather than document load Bug: T64952 Change-Id: I7985341006d587671077f3dc32dd02e8dfb38972 --- M resources/ext.popups.disablenavpop.js M resources/ext.popups.renderer.js 2 files changed, 9 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Popups refs/changes/08/183008/1 diff --git a/resources/ext.popups.disablenavpop.js b/resources/ext.popups.disablenavpop.js index 7c941da..905e4f4 100644 --- a/resources/ext.popups.disablenavpop.js +++ b/resources/ext.popups.disablenavpop.js @@ -4,13 +4,16 @@ // The `disablePopups` function exists if NavPopups is activated. If it // exists, its called, otherwise, we do nothing. +// Since NavPopups is initialized several times, its best to disable it +// right when we are about to render the popup, from mw.popups.render.render. +// See https://phabricator.wikimedia.org/T64952#800921 + // This should be happening in NavPopups itself or by disabling the gadget // HACK: This is a temporary fix ( function ( $, mw ) { - // NavPopups sets everything up on window load and not on DOM ready. - $( window ).load( function () { + mw.popups.disableNavPopup = function () { if ( typeof disablePopups !== 'undefined' && mw.popups.enabled ) { disablePopups(); } - } ); + } } ( jQuery, mediaWiki ) ); diff --git a/resources/ext.popups.renderer.js b/resources/ext.popups.renderer.js index ed45ed0..af84f43 100644 --- a/resources/ext.popups.renderer.js +++ b/resources/ext.popups.renderer.js @@ -82,6 +82,9 @@ return; } + // Disable Navigration Popups + mw.popups.disableNavPopup() + mw.popups.render.currentLink = link; link.on( 'mouseleave blur', mw.popups.render.leaveInactive ); -- To view, visit https://gerrit.wikimedia.org/r/183008 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7985341006d587671077f3dc32dd02e8dfb38972 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Popups Gerrit-Branch: master Gerrit-Owner: Prtksxna <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
