From e88cd81f94feb36f2c7b6f1627b745d8b195c862 Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Sun, 10 Jun 2018 14:14:23 +0100 Subject: [PATCH] Follow-up Ifdc951f: Don't use getLocalApi when VE not available These popups on used on the 2010 wikitext editor as well, so we can't use ve.init.target. Change-Id: I7d4e97566dde10146893089427f95c0b598ef4bc --- modules/ve-mw/init/ve.init.MWVESwitchPopupWidget.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ve-mw/init/ve.init.MWVESwitchPopupWidget.js b/modules/ve-mw/init/ve.init.MWVESwitchPopupWidget.js index a2630f5d5c..a2600a0aec 100644 --- a/modules/ve-mw/init/ve.init.MWVESwitchPopupWidget.js +++ b/modules/ve-mw/init/ve.init.MWVESwitchPopupWidget.js @@ -41,7 +41,7 @@ mw.libs.ve.SwitchPopupWidget = function MWLibsVESwitchPopupWidget( mode, config showAgainCheckbox = new OO.ui.CheckboxInputWidget() .on( 'change', function ( value ) { var configValue = value ? '1' : ''; - ve.init.target.getLocalApi().saveOption( option, configValue ); + new mw.Api().saveOption( option, configValue ); mw.user.options.set( option, configValue ); } );