framework/js/lib/components/Switch.js
Toby Zerner a9ded36b57 Major CSS revamp
- 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.
2015-07-17 14:47:49 +09:30

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() : '';
}
}