mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 10:35:48 +00:00
Merge "Remove dead code, deleting parameters is not possible"
This commit is contained in:
commit
94268009c9
|
@ -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
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue