/*! * VisualEditor user interface MWTemplateOutlineParameterCheckboxLayout class. * * @license The MIT License (MIT); see LICENSE.txt */ /** * Container for checkbox and label * * @class * @extends OO.ui.OptionWidget * * @constructor * @param {Object} config * @cfg {string} data Parameter name * @cfg {string} label * @cfg {boolean} [required] * @cfg {boolean} [selected] */ ve.ui.MWTemplateOutlineParameterCheckboxLayout = function VeUiMWTemplateOutlineParameterCheckboxLayout( config ) { this.checkbox = new OO.ui.CheckboxInputWidget( { title: config.required ? ve.msg( 'visualeditor-dialog-transclusion-required-parameter' ) : null, disabled: config.required, selected: config.selected || config.required } ) // FIXME: pass-through binding like [ 'emit', 'toggle' ]? .connect( this, { change: 'onCheckboxChange' } ); this.checkbox.$input.on( 'keydown', this.onKeyDown.bind( this ) ); // Parent constructor ve.ui.MWTemplateOutlineParameterCheckboxLayout.super.call( this, ve.extendObject( config, { $label: $( '