mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TemplateData
synced 2024-11-13 17:57:11 +00:00
tdDialog: handle name/alias swaps
If you changed the name to one of its own aliases, then went into the alias field to remove that alias, the "Done" button would remain disabled for no obvious reason. As such, rerun the name change handler. Also, the input error-highlight was too low specificity for current OOUI CSS, and so we weren't showing which field had an issue. Bug: T222543 Change-Id: I49ac0587c4b5e58ce1fc3c42e3dffeae8f986672
This commit is contained in:
parent
2058003ba0
commit
f3566cece2
|
@ -21,7 +21,8 @@
|
|||
padding: 0.5em 1em;
|
||||
}
|
||||
|
||||
.tdg-editscreen-input-error input {
|
||||
.tdg-editscreen-input-error input,
|
||||
.tdg-editscreen-input-error.oo-ui-inputWidget input.oo-ui-inputWidget-input {
|
||||
background-color: #ffa3a3;
|
||||
}
|
||||
|
||||
|
|
|
@ -564,6 +564,13 @@ mw.TemplateData.Dialog.prototype.onParamPropertyInputChange = function ( propert
|
|||
this.toggleNoticeMessage( 'edit', false );
|
||||
this.model.setParamProperty( this.selectedParamKey, property, value, this.language );
|
||||
}
|
||||
|
||||
// If we're changing the aliases and the name has an error, poke its change
|
||||
// handler in case that error was because of a duplicate name with its own
|
||||
// aliases.
|
||||
if ( property === 'aliases' && this.propInputs.name.$element.hasClass( 'tdg-editscreen-input-error' ) ) {
|
||||
this.onParamPropertyInputChange( 'name', this.propInputs.name.getValue() );
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue