mirror of
https://github.com/flarum/framework.git
synced 2025-05-21 22:36:01 +08:00
Massive JavaScript cleanup
- Use JSX for templates - Docblock/comment everything - Mostly passes ESLint (still some work to do) - Lots of renaming, refactoring, etc. CSS hasn't been updated yet.
This commit is contained in:
17
js/lib/components/Switch.js
Normal file
17
js/lib/components/Switch.js
Normal file
@ -0,0 +1,17 @@
|
||||
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 += ' switch';
|
||||
}
|
||||
|
||||
getDisplay() {
|
||||
return '';
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user