mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 02:23:58 +00:00
Merge "Rename misleading templateParameterAdded event"
This commit is contained in:
commit
1a4bb6c5e4
|
@ -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 ) );
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -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 ) {
|
||||
|
|
Loading…
Reference in a new issue