mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-09-23 18:29:35 +00:00
Use pg.fn.disablePopups to detect and stop NavigationPopups
The global disablePopups function from NavigationPopups got scoped to pg.fn.disabledPopups at some point. We were relying on that function to both detect and disable the gadget. Bug: T109912 Change-Id: I3d6de60ca2a387e45675ddb04cdc45b0f967e46a
This commit is contained in:
parent
56ec557e22
commit
1270c240c9
|
@ -1,7 +1,7 @@
|
|||
/*global disablePopups: false*/
|
||||
/*global pg: false*/
|
||||
|
||||
// Disable NavigationPopups
|
||||
// The `disablePopups` function exists if NavPopups is activated. If it
|
||||
// The `pg.fn.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
|
||||
|
@ -12,8 +12,11 @@
|
|||
// HACK: This is a temporary fix
|
||||
( function ( $, mw ) {
|
||||
mw.popups.disableNavPopup = function () {
|
||||
if ( typeof disablePopups !== 'undefined' && mw.popups.enabled ) {
|
||||
disablePopups();
|
||||
if ( typeof pg !== 'undefined' &&
|
||||
pg.fn.disablePopups !== undefined &&
|
||||
mw.popups.enabled
|
||||
) {
|
||||
pg.fn.disablePopups();
|
||||
}
|
||||
};
|
||||
} ( jQuery, mediaWiki ) );
|
||||
|
|
|
@ -8,10 +8,12 @@
|
|||
|
||||
/**
|
||||
* Check if the navigation popups gadget is enabled by looking for
|
||||
* the `disablePopups` method
|
||||
* the `pg.fn.disablePopups` method
|
||||
* @property navPopEnabled
|
||||
*/
|
||||
settings.navPopEnabled = ( typeof disablePopups !== 'undefined' );
|
||||
/*global pg: false*/
|
||||
settings.navPopEnabled = ( typeof pg !== 'undefined' &&
|
||||
pg.fn.disablePopups !== undefined );
|
||||
|
||||
/**
|
||||
* The settings' dialog's section element.
|
||||
|
|
Loading…
Reference in a new issue