From d922c1295703d34c60f53fb07f9eb961c5bf089e Mon Sep 17 00:00:00 2001 From: Thiemo Kreuz Date: Tue, 26 Jul 2022 13:21:39 +0200 Subject: [PATCH] Remove dead code, deleting parameters is not possible This code was for when the dialog had a trash can icon for every parameter, and parameters could actually be deleted. It's unreachable now. We missed this when removing the old workflow. Change-Id: Ic94df506ea84009a1e1863a4e9847a70498df448 --- modules/ve-mw/dm/models/ve.dm.MWTemplateModel.js | 15 --------------- .../ui/dialogs/ve.ui.MWTransclusionDialog.js | 9 +-------- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/modules/ve-mw/dm/models/ve.dm.MWTemplateModel.js b/modules/ve-mw/dm/models/ve.dm.MWTemplateModel.js index 1e4cb512e3..fadebc8ab4 100644 --- a/modules/ve-mw/dm/models/ve.dm.MWTemplateModel.js +++ b/modules/ve-mw/dm/models/ve.dm.MWTemplateModel.js @@ -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 diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWTransclusionDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWTransclusionDialog.js index 1a83e5c303..ce5f9f31f3 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWTransclusionDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWTransclusionDialog.js @@ -111,14 +111,7 @@ ve.ui.MWTransclusionDialog.prototype.onOutlineControlsRemove = function () { var itemId = this.findSelectedItemId(), 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 ); } };