mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-12-18 02:00:53 +00:00
c597522b7d
This means that users of the mobile site on a desktop browser will now benefit from Popups. Targets is not necessary for `ext.popups.images` as these modules are enabled on mobile by default. Bug: T236097 Change-Id: I401fbb522ec97fdc81259702c8283c95386531af
9 lines
358 B
JavaScript
9 lines
358 B
JavaScript
// Load Popups outside the critical rendering path (T176211) provided that touch events
|
|
// are not available in the browser. If touch events are enabled page previews will not load.
|
|
mw.requestIdleCallback( function () {
|
|
var isTouchDevice = 'ontouchstart' in document.documentElement;
|
|
if ( !isTouchDevice ) {
|
|
mw.loader.using( 'ext.popups.main' );
|
|
}
|
|
} );
|