Merge "Delete default sort key if set to empty string"

This commit is contained in:
jenkins-bot 2013-06-21 20:10:12 +00:00 committed by Gerrit Code Review
commit c32378b571

View file

@ -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