Merge "Remove dead code, deleting parameters is not possible"

This commit is contained in:
jenkins-bot 2022-07-27 09:41:51 +00:00 committed by Gerrit Code Review
commit 94268009c9
2 changed files with 1 additions and 23 deletions

View file

@ -263,21 +263,6 @@ ve.dm.MWTemplateModel.prototype.getOrderedParameterNames = function () {
return this.orderedParameterNames;
};
/**
* @private
* @param {string} id Parameter ID
* @return {ve.dm.MWParameterModel|null} Parameter with matching ID, null if no parameters match
*/
ve.dm.MWTemplateModel.prototype.getParameterFromId = function ( id ) {
for ( var name in this.params ) {
if ( this.params[ name ].getId() === id ) {
return this.params[ name ];
}
}
return null;
};
/**
* @param {ve.dm.MWParameterModel} param Parameter to add
* @fires add

View file

@ -111,14 +111,7 @@ ve.ui.MWTransclusionDialog.prototype.onOutlineControlsRemove = function () {
var itemId = this.bookletLayout.getSelectedTopLevelPartId(),
part = this.transclusionModel.getPartFromId( itemId );
// Check if the part is the actual template, or one of its parameters
// TODO: This applies to the old sidebar only and can be removed later
if ( part instanceof ve.dm.MWTemplateModel && itemId !== part.getId() ) {
var param = part.getParameterFromId( itemId );
if ( param ) {
param.remove();
}
} else if ( part instanceof ve.dm.MWTransclusionPartModel ) {
if ( part ) {
this.transclusionModel.removePart( part );
}
};