mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 06:46:26 +00:00
Ensure widgets are always torn down when categories page is closed
Previously a return statement meant they weren't. Bug: T139196 Change-Id: Ic7bc14a929430ac6e9d2546fc9e1a1a02635ca77
This commit is contained in:
parent
40d606abdc
commit
34135c7643
|
@ -282,26 +282,23 @@ ve.ui.MWCategoriesPage.prototype.teardown = function ( data ) {
|
||||||
attributes: { content: newDefaultSortKey }
|
attributes: { content: newDefaultSortKey }
|
||||||
};
|
};
|
||||||
|
|
||||||
data = data || {};
|
if ( data && data.action === 'apply' ) {
|
||||||
if ( data.action !== 'apply' ) {
|
// Alter the default sort key iff it's been touched & is actually different
|
||||||
return;
|
if ( this.defaultSortKeyTouched ) {
|
||||||
}
|
if ( newDefaultSortKey === '' ) {
|
||||||
|
if ( currentDefaultSortKeyItem ) {
|
||||||
// Alter the default sort key iff it's been touched & is actually different
|
currentDefaultSortKeyItem.remove();
|
||||||
if ( this.defaultSortKeyTouched ) {
|
}
|
||||||
if ( newDefaultSortKey === '' ) {
|
} else {
|
||||||
if ( currentDefaultSortKeyItem ) {
|
if ( !currentDefaultSortKeyItem ) {
|
||||||
currentDefaultSortKeyItem.remove();
|
this.metaList.insertMeta( newDefaultSortKeyData );
|
||||||
}
|
} else if ( currentDefaultSortKeyItem.getAttribute( 'content' ) !== newDefaultSortKey ) {
|
||||||
} else {
|
currentDefaultSortKeyItem.replaceWith(
|
||||||
if ( !currentDefaultSortKeyItem ) {
|
ve.extendObject( true, {},
|
||||||
this.metaList.insertMeta( newDefaultSortKeyData );
|
currentDefaultSortKeyItem.getElement(),
|
||||||
} else if ( currentDefaultSortKeyItem.getAttribute( 'content' ) !== newDefaultSortKey ) {
|
newDefaultSortKeyData
|
||||||
currentDefaultSortKeyItem.replaceWith(
|
) );
|
||||||
ve.extendObject( true, {},
|
}
|
||||||
currentDefaultSortKeyItem.getElement(),
|
|
||||||
newDefaultSortKeyData
|
|
||||||
) );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue