3 * A widget representing a single toggle filter
5 * @extends OO.ui.CheckboxInputWidget
8 * @param {Object} config Configuration object
10 mw
.rcfilters
.ui
.CheckboxInputWidget
= function MwRcfiltersUiCheckboxInputWidget( config
) {
11 config
= config
|| {};
14 mw
.rcfilters
.ui
.CheckboxInputWidget
.parent
.call( this, config
);
17 this.$input
.on( 'change', this.onUserChange
.bind( this ) );
22 OO
.inheritClass( mw
.rcfilters
.ui
.CheckboxInputWidget
, OO
.ui
.CheckboxInputWidget
);
28 * @param {boolean} Current state of the checkbox
30 * The user has checked or unchecked this checkbox
36 * Respond to checkbox change by a user and emit 'userChange'.
38 mw
.rcfilters
.ui
.CheckboxInputWidget
.prototype.onUserChange = function () {
39 this.emit( 'userChange', this.$input
.prop( 'checked' ) );