mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TemplateData
synced 2024-11-28 01:30:00 +00:00
Merge "Inline some trivial single-use variables"
This commit is contained in:
commit
09677910fe
|
@ -542,8 +542,7 @@ Dialog.prototype.onMapInfoChange = function ( value ) {
|
||||||
try {
|
try {
|
||||||
// This parsing method keeps only the last key/value pair if duplicate keys are defined, and does not throw an error.
|
// This parsing method keeps only the last key/value pair if duplicate keys are defined, and does not throw an error.
|
||||||
// Our model will be updated with a valid maps object, but the user may lose their input if it has duplicate key.
|
// Our model will be updated with a valid maps object, but the user may lose their input if it has duplicate key.
|
||||||
var mapValue = JSON.parse( value );
|
this.mapsCache[ selectedItem.label ] = JSON.parse( value );
|
||||||
this.mapsCache[ selectedItem.label ] = mapValue;
|
|
||||||
this.actions.setAbilities( { done: true } );
|
this.actions.setAbilities( { done: true } );
|
||||||
} catch ( err ) {
|
} catch ( err ) {
|
||||||
// Otherwise disable the done button if maps object is populated
|
// Otherwise disable the done button if maps object is populated
|
||||||
|
@ -1134,17 +1133,14 @@ Dialog.prototype.changeParamPropertyInput = function ( paramKey, propName, value
|
||||||
* @param {string} paramKey Parameter key in the model
|
* @param {string} paramKey Parameter key in the model
|
||||||
*/
|
*/
|
||||||
Dialog.prototype.addParamToSelectWidget = function ( paramKey ) {
|
Dialog.prototype.addParamToSelectWidget = function ( paramKey ) {
|
||||||
var paramItem,
|
var data = this.model.getParamData( paramKey );
|
||||||
data = this.model.getParamData( paramKey );
|
|
||||||
|
|
||||||
paramItem = new ParamWidget( {
|
this.paramSelect.addItems( [ new ParamWidget( {
|
||||||
key: paramKey,
|
key: paramKey,
|
||||||
label: this.model.getParamValue( paramKey, 'label', this.language ),
|
label: this.model.getParamValue( paramKey, 'label', this.language ),
|
||||||
aliases: data.aliases,
|
aliases: data.aliases,
|
||||||
description: this.model.getParamValue( paramKey, 'description', this.language )
|
description: this.model.getParamValue( paramKey, 'description', this.language )
|
||||||
} );
|
} ) ] );
|
||||||
|
|
||||||
this.paramSelect.addItems( [ paramItem ] );
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue