discourse/app/assets/javascripts/admin/components/site-settings/bool.js.es6

18 lines
370 B
Plaintext
Raw Normal View History

import computed from "ember-addons/ember-computed-decorators";
export default Ember.Component.extend({
@computed("value")
enabled: {
get(value) {
2018-06-15 23:03:24 +08:00
if (Ember.isEmpty(value)) {
return false;
}
return value.toString() === "true";
},
set(value) {
this.set("value", value ? "true" : "false");
return value;
}
2018-06-15 23:03:24 +08:00
}
});