Don't try to focus a removed template parameter

The event "focusTemplateParameterById" targets the right side of the
dialog. The input field for the parameter should be focussed. This
doesn't make any sense when the parameter was just removed (i.e.
unselected).

Change-Id: Ie75b1edaebe9d0444b98e66cb56a5c7774393bea
This commit is contained in:
Thiemo Kreuz 2021-10-20 16:39:43 +02:00 committed by Thiemo Kreuz (WMDE)
parent 0a8b462b0f
commit 937352a138

View file

@ -188,7 +188,7 @@ ve.ui.MWTransclusionOutlineTemplateWidget.prototype.onTemplateParameterChoose =
this.onTemplateParameterSelectionChanged( item, selected ); this.onTemplateParameterSelectionChanged( item, selected );
var param = this.templateModel.getParameter( item.getData() ); var param = this.templateModel.getParameter( item.getData() );
if ( param ) { if ( param && selected ) {
this.emit( 'focusTemplateParameterById', param.getId() ); this.emit( 'focusTemplateParameterById', param.getId() );
} }
}; };