mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 00:30:44 +00:00
Merge "Emit select null on selected item removal"
This commit is contained in:
commit
8d135a0813
|
@ -377,6 +377,9 @@ ve.ui.SelectWidget.prototype.removeItems = function ( items ) {
|
|||
// Remove existing item
|
||||
delete this.hashes[hash];
|
||||
}
|
||||
if ( item.isSelected() ) {
|
||||
this.selectItem( null );
|
||||
}
|
||||
}
|
||||
ve.ui.GroupElement.prototype.removeItems.call( this, items );
|
||||
|
||||
|
@ -399,6 +402,7 @@ ve.ui.SelectWidget.prototype.clearItems = function () {
|
|||
// Clear all items
|
||||
this.hashes = {};
|
||||
ve.ui.GroupElement.prototype.clearItems.call( this );
|
||||
this.selectItem( null );
|
||||
|
||||
this.emit( 'remove', items );
|
||||
|
||||
|
|
Loading…
Reference in a new issue