mirror of
https://github.com/flarum/framework.git
synced 2024-11-24 18:05:08 +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() : '';
|
|
}
|
|
}
|