mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 02:23:58 +00:00
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:
parent
d57210c1c0
commit
3f938d3c4f
|
@ -47,7 +47,7 @@ ve.ui.MWTwoPaneTransclusionDialogLayout = function VeUiMWTwoPaneTransclusionDial
|
||||||
this.sidebar.connect( this, {
|
this.sidebar.connect( this, {
|
||||||
filterPagesByName: 'onFilterPagesByName',
|
filterPagesByName: 'onFilterPagesByName',
|
||||||
sidebarPartSelected: 'onSidebarItemSelected',
|
sidebarPartSelected: 'onSidebarItemSelected',
|
||||||
templateParameterAdded: 'onSidebarItemSelected'
|
templateParameterSelected: 'onSidebarItemSelected'
|
||||||
} );
|
} );
|
||||||
// Event 'focus' does not bubble, but 'focusin' does
|
// Event 'focus' does not bubble, but 'focusin' does
|
||||||
this.stackLayout.$element.on( 'focusin', this.onStackLayoutFocus.bind( this ) );
|
this.stackLayout.$element.on( 'focusin', this.onStackLayoutFocus.bind( this ) );
|
||||||
|
|
|
@ -59,7 +59,7 @@ OO.inheritClass( ve.ui.MWTransclusionOutlineTemplateWidget, ve.ui.MWTransclusion
|
||||||
/* Events */
|
/* Events */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @event templateParameterAdded
|
* @event templateParameterSelected
|
||||||
* @param {string} pageName Unique id of the {@see OO.ui.BookletLayout} page, e.g. something like
|
* @param {string} pageName Unique id of the {@see OO.ui.BookletLayout} page, e.g. something like
|
||||||
* "part_1" or "part_1/param1".
|
* "part_1" or "part_1/param1".
|
||||||
* @param {boolean} soft If true, focus should stay in the sidebar.
|
* @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 {OO.ui.OptionWidget} item
|
||||||
* @param {boolean} selected
|
* @param {boolean} selected
|
||||||
* @param {boolean} soft If true, focus should stay in the sidebar.
|
* @param {boolean} soft If true, focus should stay in the sidebar.
|
||||||
* @fires templateParameterAdded
|
* @fires templateParameterSelected
|
||||||
*/
|
*/
|
||||||
ve.ui.MWTransclusionOutlineTemplateWidget.prototype.toggleParameter = function ( item, selected, soft ) {
|
ve.ui.MWTransclusionOutlineTemplateWidget.prototype.toggleParameter = function ( item, selected, soft ) {
|
||||||
var paramName = item.getData(),
|
var paramName = item.getData(),
|
||||||
|
@ -323,7 +323,7 @@ ve.ui.MWTransclusionOutlineTemplateWidget.prototype.toggleParameter = function (
|
||||||
this.updateUnusedParameterToggleState();
|
this.updateUnusedParameterToggleState();
|
||||||
|
|
||||||
if ( param && selected ) {
|
if ( param && selected ) {
|
||||||
this.emit( 'templateParameterAdded', param.getId(), soft );
|
this.emit( 'templateParameterSelected', param.getId(), soft );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -97,7 +97,7 @@ ve.ui.MWTransclusionOutlineWidget.prototype.addPartWidget = function ( part, new
|
||||||
widget.connect( this, {
|
widget.connect( this, {
|
||||||
// We can forward these events as is. The parameter's unique ids are reused as page
|
// We can forward these events as is. The parameter's unique ids are reused as page
|
||||||
// names in {@see ve.ui.MWTemplateDialog.onAddParameter}.
|
// names in {@see ve.ui.MWTemplateDialog.onAddParameter}.
|
||||||
templateParameterAdded: [ 'emit', 'templateParameterAdded' ],
|
templateParameterSelected: [ 'emit', 'templateParameterSelected' ],
|
||||||
filterParametersById: 'onFilterParametersByName'
|
filterParametersById: 'onFilterParametersByName'
|
||||||
} );
|
} );
|
||||||
} else if ( part instanceof ve.dm.MWTemplatePlaceholderModel ) {
|
} else if ( part instanceof ve.dm.MWTemplatePlaceholderModel ) {
|
||||||
|
|
Loading…
Reference in a new issue