mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TemplateData
synced 2024-11-27 17:20:01 +00:00
Merge "Remove unused return true
from addParam() method"
This commit is contained in:
commit
ae345d50ac
|
@ -337,10 +337,8 @@ Model.prototype.importSourceCodeParameters = function () {
|
|||
|
||||
// Add sourceCodeParameters to the model
|
||||
this.sourceCodeParameters.forEach( function ( sourceCodeParameter ) {
|
||||
if (
|
||||
existingArray.indexOf( sourceCodeParameter ) === -1 &&
|
||||
model.addParam( sourceCodeParameter )
|
||||
) {
|
||||
if ( existingArray.indexOf( sourceCodeParameter ) === -1 ) {
|
||||
model.addParam( sourceCodeParameter );
|
||||
importedArray.push( sourceCodeParameter );
|
||||
} else {
|
||||
skippedArray.push( sourceCodeParameter );
|
||||
|
@ -386,7 +384,6 @@ Model.prototype.getExistingLanguageCodes = function () {
|
|||
*
|
||||
* @param {string} key Parameter key
|
||||
* @param {Object} [paramData] Parameter data
|
||||
* @return {boolean} Parameter was added successfully
|
||||
* @fires add-param
|
||||
* @fires change
|
||||
*/
|
||||
|
@ -470,7 +467,6 @@ Model.prototype.addParam = function ( key, paramData ) {
|
|||
// Trigger the add parameter event
|
||||
this.emit( 'add-param', key, this.params[ key ] );
|
||||
this.emit( 'change' );
|
||||
return true;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -757,14 +757,10 @@ Dialog.prototype.onAddParamButtonClick = function () {
|
|||
|
||||
var newParamKey = this.newParamInput.getValue().trim();
|
||||
if ( this.model.isParamDeleted( newParamKey ) ) {
|
||||
// Empty param
|
||||
this.model.emptyParamData( newParamKey );
|
||||
} else if ( !this.model.isParamExists( newParamKey ) ) {
|
||||
// Add to model
|
||||
if ( this.model.addParam( newParamKey ) ) {
|
||||
// Add parameter to list
|
||||
this.addParamToSelectWidget( newParamKey );
|
||||
}
|
||||
this.model.addParam( newParamKey );
|
||||
this.addParamToSelectWidget( newParamKey );
|
||||
}
|
||||
// Reset the input
|
||||
this.newParamInput.setValue( '' );
|
||||
|
|
Loading…
Reference in a new issue