| 1 |
const UtilMixin = require( './UtilMixin.js' ); |
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
function BooleanToggleSwitchParamWidget() { |
| 11 |
BooleanToggleSwitchParamWidget.super.call( this ); |
| 12 |
} |
| 13 |
|
| 14 |
OO.inheritClass( BooleanToggleSwitchParamWidget, OO.ui.ToggleSwitchWidget ); |
| 15 |
OO.mixinClass( BooleanToggleSwitchParamWidget, UtilMixin ); |
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
BooleanToggleSwitchParamWidget.prototype.getApiValue = function () { |
| 21 |
return this.getValue() ? 1 : undefined; |
| 22 |
}; |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
BooleanToggleSwitchParamWidget.prototype.setApiValue = function ( newValue ) { |
| 28 |
this.setValue( this.apiBool( newValue ) ); |
| 29 |
}; |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
BooleanToggleSwitchParamWidget.prototype.apiCheckValid = function () { |
| 35 |
return $.Deferred().resolve( true ).promise(); |
| 36 |
}; |
| 37 |
|
| 38 |
module.exports = BooleanToggleSwitchParamWidget; |