mirror of
https://github.com/flarum/core.git
synced 2025-07-26 03:01:22 +02:00
Webpack (#1367)
* Replace gulp with webpack and npm scripts for JS compilation * Set up Travis CI to commit compiled JS * Restructure `js` directory; only one instance of npm, forum/admin are "submodules" * Refactor JS initializers into Application subclasses * Maintain partial compatibility API (importing from absolute paths) for extensions * Remove minification responsibility from PHP asset compiler * Restructure `less` directory
This commit is contained in:
17
js/src/common/components/Switch.js
Normal file
17
js/src/common/components/Switch.js
Normal file
@@ -0,0 +1,17 @@
|
||||
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() : '';
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user