mirror of
https://github.com/flarum/core.git
synced 2025-10-12 15:34:26 +02:00
User settings GUI, including some new components
This commit is contained in:
19
ember/app/components/ui/switch-input.js
Normal file
19
ember/app/components/ui/switch-input.js
Normal file
@@ -0,0 +1,19 @@
|
||||
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);
|
||||
});
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user