mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 00:30:44 +00:00
Merge "Don't rely on 'user' and 'site' modules working correctly"
This commit is contained in:
commit
7dee4f18d7
|
@ -992,7 +992,7 @@ ve.init.mw.Target.prototype.getHtml = function ( newDoc ) {
|
||||||
* @returns {boolean} Loading has been started
|
* @returns {boolean} Loading has been started
|
||||||
*/
|
*/
|
||||||
ve.init.mw.Target.prototype.load = function ( additionalModules ) {
|
ve.init.mw.Target.prototype.load = function ( additionalModules ) {
|
||||||
var data, start, xhr, target = this;
|
var data, start, xhr, modulesPromise, additionalModulesPromise, target = this;
|
||||||
|
|
||||||
// Prevent duplicate requests
|
// Prevent duplicate requests
|
||||||
if ( this.loading ) {
|
if ( this.loading ) {
|
||||||
|
@ -1000,11 +1000,16 @@ ve.init.mw.Target.prototype.load = function ( additionalModules ) {
|
||||||
}
|
}
|
||||||
this.events.timings.activationStart = ve.now();
|
this.events.timings.activationStart = ve.now();
|
||||||
// Start loading the module immediately
|
// Start loading the module immediately
|
||||||
mw.loader.using(
|
modulesPromise = mw.loader.using( this.modules );
|
||||||
// Wait for site and user JS before running plugins
|
additionalModulesPromise = mw.loader.using( additionalModules || [] );
|
||||||
this.modules.concat( additionalModules || [] ),
|
|
||||||
ve.init.mw.Target.onModulesReady.bind( this )
|
modulesPromise.done( function () {
|
||||||
);
|
// Wait for site and user JS before running plugins.
|
||||||
|
// These modules could fail to load, proceed even if they do.
|
||||||
|
additionalModulesPromise.always( function () {
|
||||||
|
ve.init.mw.Target.onModulesReady.call( target );
|
||||||
|
} );
|
||||||
|
} );
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
action: 'visualeditor',
|
action: 'visualeditor',
|
||||||
|
|
Loading…
Reference in a new issue