mirror of
https://github.com/flarum/framework.git
synced 2024-12-02 15:03:44 +08:00
18 lines
397 B
JavaScript
18 lines
397 B
JavaScript
import Checkbox from './Checkbox';
|
|
|
|
/**
|
|
* The `Switch` component is a `Checkbox`, but with a switch display instead of
|
|
* a tick/cross one.
|
|
*/
|
|
export default class Switch extends Checkbox {
|
|
static initProps(props) {
|
|
super.initProps(props);
|
|
|
|
props.className = (props.className || '') + ' Checkbox--switch';
|
|
}
|
|
|
|
getDisplay() {
|
|
return this.loading ? super.getDisplay() : '';
|
|
}
|
|
}
|