mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-23 23:24:39 +00:00
Enable Popups module in mobile, use feature detection to enable
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
This commit is contained in:
parent
cd1461e5ca
commit
c597522b7d
|
@ -148,11 +148,13 @@
|
|||
}
|
||||
},
|
||||
"ext.popups": {
|
||||
"targets": [ "desktop", "mobile" ],
|
||||
"scripts": [
|
||||
"resources/ext.popups/index.js"
|
||||
]
|
||||
},
|
||||
"ext.popups.main": {
|
||||
"targets": [ "desktop", "mobile" ],
|
||||
"scripts": [
|
||||
"resources/dist/index.js"
|
||||
],
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
// Load Popups outside the critical rendering path (T176211)
|
||||
// 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 () {
|
||||
mw.loader.using( 'ext.popups.main' );
|
||||
var isTouchDevice = 'ontouchstart' in document.documentElement;
|
||||
if ( !isTouchDevice ) {
|
||||
mw.loader.using( 'ext.popups.main' );
|
||||
}
|
||||
} );
|
||||
|
|
Loading…
Reference in a new issue