Make button to add undocumented template parameter work

Thanks to the widget now being an actual ButtonElement.

Bug: T274544
Change-Id: I1b0ef28b0aa115a027a07f3ae53c583598483e96
This commit is contained in:
Thiemo Kreuz 2021-07-13 12:33:52 +02:00 committed by WMDE-Fisch
parent 11978b968d
commit 198c5dba77

View file

@ -38,7 +38,8 @@ ve.ui.MWTransclusionOutlineTemplateWidget = function VeUiMWTransclusionOutlineTe
var addParameterButton = new ve.ui.MWTransclusionOutlineButtonWidget( {
icon: 'parameter',
label: ve.msg( 'visualeditor-dialog-transclusion-add-param' )
} );
} )
.connect( this, { click: 'onAddParameterButtonClick' } );
this.parameters = new OO.ui.FieldsetLayout( {
items: checkboxes
@ -131,3 +132,7 @@ ve.ui.MWTransclusionOutlineTemplateWidget.prototype.onCheckboxChange = function
}
}
};
ve.ui.MWTransclusionOutlineTemplateWidget.prototype.onAddParameterButtonClick = function () {
this.templateModel.addParameter( new ve.dm.MWParameterModel( this.templateModel ) );
};