OOUI .addItems() must be called with an array

Some versions of OOUI also accepted single non-array items. But this
was never official. Let's follow the spec.

Change-Id: Ie14431be802a6c71127c1b418e750ce5c9beb863
This commit is contained in:
thiemowmde 2023-01-05 16:32:18 +01:00
parent d117393e75
commit 9c1031c3fa

View file

@ -73,21 +73,18 @@
);
// remove real item from item list, without touching the DOM
this.removeItems( item );
this.removeItems( [ item ] );
// insert real item, hidden
item.$element.hide();
this.addItems( item );
// insert fake
this.addItems( fakeWidget );
this.addItems( [ item, fakeWidget ] );
// fade out fake
// FIXME: Use CSS transition
// eslint-disable-next-line no-jquery/no-fade
fakeWidget.$element.fadeOut( 400, function () {
// remove fake
widget.removeItems( fakeWidget );
widget.removeItems( [ fakeWidget ] );
// fade-in real item
// eslint-disable-next-line no-jquery/no-fade
item.$element.fadeIn( 400 );