AceEditorWidget: Use mw.loader#getState instead of private moduleRegistry

Change-Id: I845651af837ccc042b6193876e17ba2b571dfe9c
This commit is contained in:
Ed Sanders 2015-10-26 09:31:37 +00:00
parent 565a10da61
commit 35b9c4119a

View file

@ -55,7 +55,7 @@ OO.inheritClass( ve.ui.MWAceEditorWidget, ve.ui.WhitespacePreservingTextInputWid
*/ */
ve.ui.MWAceEditorWidget.prototype.setup = function () { ve.ui.MWAceEditorWidget.prototype.setup = function () {
if ( !this.loadingPromise ) { if ( !this.loadingPromise ) {
this.loadingPromise = mw.loader.moduleRegistry.hasOwnProperty( 'ext.codeEditor.ace.modes' ) ? this.loadingPromise = mw.loader.getState( 'ext.codeEditor.ace.modes' ) ?
mw.loader.using( 'ext.codeEditor.ace.modes' ).then( this.setupEditor.bind( this ) ) : mw.loader.using( 'ext.codeEditor.ace.modes' ).then( this.setupEditor.bind( this ) ) :
$.Deferred().reject().promise(); $.Deferred().reject().promise();
} }