mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-12 06:27:01 +00:00
Update AddParameterPage validation when the template changes
This applies in several situations. A trivial one is a parameter that's already in use, but you uncheck it while the relevant error message is shown. Vice versa. Bug: T290977 Change-Id: Ia4114194a2efe34a7d51e633c776ce892cc9cb18
This commit is contained in:
parent
7bbdca3fb9
commit
51ad403117
|
@ -18,7 +18,12 @@ ve.ui.MWAddParameterPage = function VeUiMWAddParameterPage( parameter, name, con
|
|||
scrollable: false
|
||||
}, config ) );
|
||||
|
||||
this.template = parameter.getTemplate();
|
||||
this.template = parameter.getTemplate()
|
||||
.connect( this, {
|
||||
// There is a "change" event, but it triggers way to often even for content changes
|
||||
add: 'onTemplateParametersChanged',
|
||||
remove: 'onTemplateParametersChanged'
|
||||
} );
|
||||
this.isExpanded = false;
|
||||
|
||||
// Header button to expand
|
||||
|
@ -96,6 +101,13 @@ ve.ui.MWAddParameterPage.prototype.focus = function () {
|
|||
ve.ui.MWAddParameterPage.super.prototype.focus.apply( this, arguments );
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
ve.ui.MWAddParameterPage.prototype.onTemplateParametersChanged = function () {
|
||||
this.onParameterNameChanged( this.paramInputField.getValue() );
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param {string} value
|
||||
|
|
Loading…
Reference in a new issue