Move module pre-loading from DAT.init to ArticleTarget

This makes this feature available on Mobile as well.

Change-Id: I26a2af63b3665f5563f8562f1a8e94287cad439f
This commit is contained in:
Ed Sanders 2018-06-10 16:04:15 +01:00
parent c04e934361
commit 6459de6978
2 changed files with 6 additions and 5 deletions

View file

@ -275,11 +275,6 @@
targetPromise.then( function ( target ) {
target.section = section;
// Enqueue the loading of deferred modules (that is, modules which provide
// functionality that is not needed for loading the editor).
setTimeout( function () {
mw.loader.load( 'easy-deflate.deflate' );
}, 500 );
} );
return targetPromise;

View file

@ -540,6 +540,12 @@ ve.init.mw.ArticleTarget.prototype.surfaceReady = function () {
surfaceModel.startStoringChanges();
// TODO: Listen to autosaveFailed event to notify user
// Start loading easy-deflate module in the background, so it's
// already loaded when the save dialog is opened.
setTimeout( function () {
mw.loader.load( 'easy-deflate.deflate' );
}, 500 );
// Parent method
ve.init.mw.ArticleTarget.super.prototype.surfaceReady.apply( this, arguments );
};