Add 'vector-body' hack to TargetWidgets

Bug: T313221
Change-Id: I06366d4601342435b70d311742ee985e01b0477b
This commit is contained in:
Ed Sanders 2022-07-18 14:12:10 +01:00
parent 684a69c17e
commit 33546466eb

View file

@ -17,7 +17,14 @@
* @cfg {string[]} [surfaceClasses] Surface classes to apply
*/
ve.ui.MWTargetWidget = function VeUiMWTargetWidget( config ) {
this.surfaceClasses = config.surfaceClasses;
this.surfaceClasses = ve.copy( config.surfaceClasses ) || [];
// HACK: T287733
// This assumes the target widget is being shown outside of vector-body, otherwise this
// will apply the class a second time and cause problems.
if ( mw.config.get( 'skin' ) === 'vector' || mw.config.get( 'skin' ) === 'vector-2022' ) {
this.surfaceClasses.push( 'vector-body' );
}
// Parent constructor
ve.ui.MWTargetWidget.super.apply( this, arguments );