mediawiki-extensions-Popups/resources/ext.popups.disablenavpop.js
Prateek Saxena 6eef4f325b Add jscs and jshint tasks to the Gruntfile
Adds the jscs and jshint packages for development and their tasks in
Grunt. Also fixes all the code convention errors.

Change-Id: If1c9dfdbe22d4912d78b6a51b1292866970a85cc
2015-09-04 13:57:52 +05:30

23 lines
721 B
JavaScript

/*global pg: false*/
// Disable NavigationPopups
// 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
// 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 ) {
mw.popups.disableNavPopup = function () {
if ( typeof pg !== 'undefined' &&
pg.fn.disablePopups !== undefined &&
mw.popups.enabled
) {
pg.fn.disablePopups();
}
};
}( jQuery, mediaWiki ) );