mirror of
https://github.com/flarum/framework.git
synced 2025-05-21 14:22:33 +08:00
20 lines
411 B
JavaScript
20 lines
411 B
JavaScript
import Ember from 'ember';
|
|
|
|
/**
|
|
A toggle switch.
|
|
*/
|
|
export default Ember.Component.extend({
|
|
layoutName: 'components/ui/switch-input',
|
|
classNames: ['checkbox', 'checkbox-switch'],
|
|
|
|
label: '',
|
|
toggleState: true,
|
|
|
|
didInsertElement: function() {
|
|
var component = this;
|
|
this.$('input').on('change', function() {
|
|
component.get('changed')($(this).prop('checked'), component);
|
|
});
|
|
}
|
|
});
|