mirror of
https://github.com/flarum/framework.git
synced 2024-11-29 04:33:47 +08:00
a9ded36b57
- Get rid of Bootstrap (except we still rely on some JS) - Use BEM class names - Rework variables/theme config - Fix various bugs, including some on mobile The CSS is still not ideal – it needs to be cleaned up some more. But that can be a focus for after beta.
18 lines
413 B
JavaScript
18 lines
413 B
JavaScript
import Checkbox from 'flarum/components/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() : '';
|
|
}
|
|
}
|