mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 02:23:58 +00:00
Rename misleading templateParameterSelectionChanged event
This is not only fired when a parameter is checked or unchecked. It's also not only fired when another parameter in the parameter SelectWidget is selected. It's always fired just because the spacebar is pressed. This is so we can scroll that parameter into view. Change-Id: Id621405b7ca3116cd4a06f474e49776d0830dccc
This commit is contained in:
parent
6baefa1190
commit
d57210c1c0
|
@ -46,9 +46,9 @@ OO.mixinClass( ve.ui.MWTransclusionOutlineParameterSelectWidget, ve.ui.MWAriaDes
|
|||
|
||||
/**
|
||||
* This is fired instead of the "choose" event from the {@see OO.ui.SelectWidget} base class when
|
||||
* pressing space on a parameter to toggle it, without loosing the focus.
|
||||
* pressing space on a parameter to toggle it or scroll it into view, without losing the focus.
|
||||
*
|
||||
* @event templateParameterSelectionChanged
|
||||
* @event templateParameterSpaceDown
|
||||
* @param {ve.ui.MWTransclusionOutlineParameterWidget} item
|
||||
* @param {boolean} selected
|
||||
*/
|
||||
|
@ -196,7 +196,7 @@ ve.ui.MWTransclusionOutlineParameterSelectWidget.prototype.onMouseDown = functio
|
|||
* @inheritDoc OO.ui.SelectWidget
|
||||
* @param {KeyboardEvent} e
|
||||
* @fires choose
|
||||
* @fires templateParameterSelectionChanged
|
||||
* @fires templateParameterSpaceDown
|
||||
*/
|
||||
ve.ui.MWTransclusionOutlineParameterSelectWidget.prototype.onDocumentKeyDown = function ( e ) {
|
||||
var item;
|
||||
|
@ -224,7 +224,7 @@ ve.ui.MWTransclusionOutlineParameterSelectWidget.prototype.onDocumentKeyDown = f
|
|||
} else {
|
||||
this.selectItem( item );
|
||||
}
|
||||
this.emit( 'templateParameterSelectionChanged', item, item.isSelected() );
|
||||
this.emit( 'templateParameterSpaceDown', item, item.isSelected() );
|
||||
}
|
||||
e.preventDefault();
|
||||
break;
|
||||
|
|
|
@ -103,7 +103,7 @@ ve.ui.MWTransclusionOutlineTemplateWidget.prototype.initializeParameterList = fu
|
|||
$ariaDescribedBy: $parametersAriaDescription
|
||||
} ).connect( this, {
|
||||
choose: 'onTemplateParameterChoose',
|
||||
templateParameterSelectionChanged: 'onTemplateParameterSelectionChanged',
|
||||
templateParameterSpaceDown: 'onTemplateParameterSpaceDown',
|
||||
change: 'onParameterWidgetListChanged'
|
||||
} );
|
||||
|
||||
|
@ -299,7 +299,7 @@ ve.ui.MWTransclusionOutlineTemplateWidget.prototype.onTemplateParameterChoose =
|
|||
* @param {OO.ui.OptionWidget} item
|
||||
* @param {boolean} selected
|
||||
*/
|
||||
ve.ui.MWTransclusionOutlineTemplateWidget.prototype.onTemplateParameterSelectionChanged = function ( item, selected ) {
|
||||
ve.ui.MWTransclusionOutlineTemplateWidget.prototype.onTemplateParameterSpaceDown = function ( item, selected ) {
|
||||
this.toggleParameter( item, selected, true );
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue