This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/components/preference-checkbox.js.es6
2016-03-29 19:02:59 +11:00

19 lines
339 B
JavaScript

export default Em.Component.extend({
classNames: ['controls'],
label: function() {
return I18n.t(this.get('labelKey'));
}.property('labelKey'),
click() {
const warning = this.get('warning');
if (warning && !this.get('checked')) {
this.sendAction('warning');
return false;
}
return true;
}
});