From 8bcb50b6a278a426f5cae497a14448b70a8c4839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Dziewo=C5=84ski?= Date: Sat, 22 Jan 2022 03:27:22 +0100 Subject: [PATCH] Fix showing caption and alt text fields in media and gallery dialogs We were using addItems() incorrectly, and it stopped working after change Ib1241f93d214e8a7d2f757a120f84de3879575af in OOUI. Bug: T299818 Change-Id: I2d00cb929673a419789ca6f8bc308721373e1da8 --- modules/ve-mw/ui/dialogs/ve.ui.MWGalleryDialog.js | 4 ++-- modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWGalleryDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWGalleryDialog.js index c9fc8c6b5d..d6856edb6a 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWGalleryDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWGalleryDialog.js @@ -248,7 +248,7 @@ ve.ui.MWGalleryDialog.prototype.initialize = function () { highlightedCaptionFieldset = new OO.ui.FieldsetLayout( { label: ve.msg( 'visualeditor-dialog-media-content-section' ) } ); - highlightedCaptionFieldset.addItems( highlightedCaptionField ); + highlightedCaptionFieldset.addItems( [ highlightedCaptionField ] ); highlightedAltTextField = new OO.ui.FieldLayout( this.highlightedAltTextInput, { align: 'top' @@ -256,7 +256,7 @@ ve.ui.MWGalleryDialog.prototype.initialize = function () { highlightedAltTextFieldset = new OO.ui.FieldsetLayout( { label: ve.msg( 'visualeditor-dialog-media-alttext-section' ) } ); - highlightedAltTextFieldset.addItems( highlightedAltTextField ); + highlightedAltTextFieldset.addItems( [ highlightedAltTextField ] ); // Search panel this.searchWidget = new mw.widgets.MediaSearchWidget( { diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js index b17b0503af..22be508055 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js @@ -232,7 +232,7 @@ ve.ui.MWMediaDialog.prototype.initialize = function () { help: ve.msg( 'visualeditor-dialog-media-content-section-help' ), classes: [ 've-ui-mwMediaDialog-caption-fieldset' ] } ); - this.captionFieldset.addItems( captionField ); + this.captionFieldset.addItems( [ captionField ] ); // Alt text this.altTextInput = new OO.ui.TextInputWidget( { @@ -247,7 +247,7 @@ ve.ui.MWMediaDialog.prototype.initialize = function () { label: ve.msg( 'visualeditor-dialog-media-alttext-section' ), help: ve.msg( 'visualeditor-dialog-media-alttext-section-help' ) } ); - altTextFieldset.addItems( altTextField ); + altTextFieldset.addItems( [ altTextField ] ); // Advanced settings