1 const UtilMixin
= require( './UtilMixin.js' );
4 * A wrapper for OO.ui.ToggleSwitchWidget
10 function BooleanToggleSwitchParamWidget() {
11 BooleanToggleSwitchParamWidget
.super.call( this );
14 OO
.inheritClass( BooleanToggleSwitchParamWidget
, OO
.ui
.ToggleSwitchWidget
);
15 OO
.mixinClass( BooleanToggleSwitchParamWidget
, UtilMixin
);
18 * @return {number|undefined}
20 BooleanToggleSwitchParamWidget
.prototype.getApiValue = function () {
21 return this.getValue() ? 1 : undefined;
25 * @param {any} newValue
27 BooleanToggleSwitchParamWidget
.prototype.setApiValue = function ( newValue
) {
28 this.setValue( this.apiBool( newValue
) );
32 * @return {jQuery.Promise}
34 BooleanToggleSwitchParamWidget
.prototype.apiCheckValid = function () {
35 return $.Deferred().resolve( true ).promise();
38 module
.exports
= BooleanToggleSwitchParamWidget
;