Rename misleading templateParameterAdded event

This is not only fired when a parameter is added. It's also fired
when pressing spacebar on a parameter that already exists.

Change-Id: I245aa9f5938eb38c3a3f224a4d642d57068cf23b
This commit is contained in:
Thiemo Kreuz 2022-07-15 14:24:26 +02:00
parent d57210c1c0
commit 3f938d3c4f
3 changed files with 5 additions and 5 deletions

View file

@ -47,7 +47,7 @@ ve.ui.MWTwoPaneTransclusionDialogLayout = function VeUiMWTwoPaneTransclusionDial
this.sidebar.connect( this, {
filterPagesByName: 'onFilterPagesByName',
sidebarPartSelected: 'onSidebarItemSelected',
templateParameterAdded: 'onSidebarItemSelected'
templateParameterSelected: 'onSidebarItemSelected'
} );
// Event 'focus' does not bubble, but 'focusin' does
this.stackLayout.$element.on( 'focusin', this.onStackLayoutFocus.bind( this ) );

View file

@ -59,7 +59,7 @@ OO.inheritClass( ve.ui.MWTransclusionOutlineTemplateWidget, ve.ui.MWTransclusion
/* Events */
/**
* @event templateParameterAdded
* @event templateParameterSelected
* @param {string} pageName Unique id of the {@see OO.ui.BookletLayout} page, e.g. something like
* "part_1" or "part_1/param1".
* @param {boolean} soft If true, focus should stay in the sidebar.
@ -308,7 +308,7 @@ ve.ui.MWTransclusionOutlineTemplateWidget.prototype.onTemplateParameterSpaceDown
* @param {OO.ui.OptionWidget} item
* @param {boolean} selected
* @param {boolean} soft If true, focus should stay in the sidebar.
* @fires templateParameterAdded
* @fires templateParameterSelected
*/
ve.ui.MWTransclusionOutlineTemplateWidget.prototype.toggleParameter = function ( item, selected, soft ) {
var paramName = item.getData(),
@ -323,7 +323,7 @@ ve.ui.MWTransclusionOutlineTemplateWidget.prototype.toggleParameter = function (
this.updateUnusedParameterToggleState();
if ( param && selected ) {
this.emit( 'templateParameterAdded', param.getId(), soft );
this.emit( 'templateParameterSelected', param.getId(), soft );
}
};

View file

@ -97,7 +97,7 @@ ve.ui.MWTransclusionOutlineWidget.prototype.addPartWidget = function ( part, new
widget.connect( this, {
// We can forward these events as is. The parameter's unique ids are reused as page
// names in {@see ve.ui.MWTemplateDialog.onAddParameter}.
templateParameterAdded: [ 'emit', 'templateParameterAdded' ],
templateParameterSelected: [ 'emit', 'templateParameterSelected' ],
filterParametersById: 'onFilterParametersByName'
} );
} else if ( part instanceof ve.dm.MWTemplatePlaceholderModel ) {