Conditional loading of a module by mw.loader.using
can take some time if the requested module is big (e.g. because of a dependency to oojs-ui
). The user does not know that something is being loaded in the background. Is there a way to show a “Loading” mask (with a spinner) above the whole document until a module is loaded?
I imagine something like this:
mw.loader.pushPending();
mw.loader.using( 'some-module-that-depends-on-oojs' ).done( function() {
mw.loader.popPending();
//Show dialog...
});
I’ve looked at https://doc.wikimedia.org/oojs-ui/master/js/ and https://doc.wikimedia.org/mediawiki-core/master/js/ but only found OO.ui.mixin.PendingElement
which - unfortunately - is part of oojs-ui
and therefore not available for my purpose.
Or is there another recommendation for this case?