mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 18:39:52 +00:00
Merge "Delete default sort key if set to empty string"
This commit is contained in:
commit
c32378b571
|
@ -179,6 +179,7 @@ ve.ui.MWMetaDialog.prototype.onClose = function ( action ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( this.defaultSortKeyChanged ) {
|
if ( this.defaultSortKeyChanged ) {
|
||||||
|
if ( this.defaultSortInput.getValue() !== '' ) {
|
||||||
newDefaultSortKeyItemData = {
|
newDefaultSortKeyItemData = {
|
||||||
'type': 'mwDefaultSort',
|
'type': 'mwDefaultSort',
|
||||||
'attributes': { 'content': this.defaultSortInput.getValue() }
|
'attributes': { 'content': this.defaultSortInput.getValue() }
|
||||||
|
@ -192,6 +193,9 @@ ve.ui.MWMetaDialog.prototype.onClose = function ( action ) {
|
||||||
newDefaultSortKeyItem = new ve.dm.MWDefaultSortMetaItem( newDefaultSortKeyItemData );
|
newDefaultSortKeyItem = new ve.dm.MWDefaultSortMetaItem( newDefaultSortKeyItemData );
|
||||||
this.metaList.insertMeta( newDefaultSortKeyItem );
|
this.metaList.insertMeta( newDefaultSortKeyItem );
|
||||||
}
|
}
|
||||||
|
} else if ( currentDefaultSortKeyItem ) {
|
||||||
|
currentDefaultSortKeyItem.remove();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return to normal tracking behavior
|
// Return to normal tracking behavior
|
||||||
|
|
Loading…
Reference in a new issue