mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-12-18 02:40:50 +00:00
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:
parent
d117393e75
commit
9c1031c3fa
|
@ -73,21 +73,18 @@
|
||||||
);
|
);
|
||||||
|
|
||||||
// remove real item from item list, without touching the DOM
|
// remove real item from item list, without touching the DOM
|
||||||
this.removeItems( item );
|
this.removeItems( [ item ] );
|
||||||
|
|
||||||
// insert real item, hidden
|
// insert real item, hidden
|
||||||
item.$element.hide();
|
item.$element.hide();
|
||||||
this.addItems( item );
|
this.addItems( [ item, fakeWidget ] );
|
||||||
|
|
||||||
// insert fake
|
|
||||||
this.addItems( fakeWidget );
|
|
||||||
|
|
||||||
// fade out fake
|
// fade out fake
|
||||||
// FIXME: Use CSS transition
|
// FIXME: Use CSS transition
|
||||||
// eslint-disable-next-line no-jquery/no-fade
|
// eslint-disable-next-line no-jquery/no-fade
|
||||||
fakeWidget.$element.fadeOut( 400, function () {
|
fakeWidget.$element.fadeOut( 400, function () {
|
||||||
// remove fake
|
// remove fake
|
||||||
widget.removeItems( fakeWidget );
|
widget.removeItems( [ fakeWidget ] );
|
||||||
// fade-in real item
|
// fade-in real item
|
||||||
// eslint-disable-next-line no-jquery/no-fade
|
// eslint-disable-next-line no-jquery/no-fade
|
||||||
item.$element.fadeIn( 400 );
|
item.$element.fadeIn( 400 );
|
||||||
|
|
Loading…
Reference in a new issue