jenkins-bot has submitted this change and it was merged.

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, 8 insertions(+), 3 deletions(-)

Approvals:
  Werdna: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/resources/ext.popups.disablenavpop.js 
b/resources/ext.popups.disablenavpop.js
index 7c941da..d7e6bb3 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 3d17c5f..0781ad2 100644
--- a/resources/ext.popups.renderer.js
+++ b/resources/ext.popups.renderer.js
@@ -87,6 +87,8 @@
                        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: merged
Gerrit-Change-Id: I7985341006d587671077f3dc32dd02e8dfb38972
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Popups
Gerrit-Branch: master
Gerrit-Owner: Prtksxna <[email protected]>
Gerrit-Reviewer: TheDJ <[email protected]>
Gerrit-Reviewer: Werdna <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to