mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-23 00:24:19 +08:00
17 lines
395 B
JavaScript
Vendored
17 lines
395 B
JavaScript
Vendored
import Component from "@ember/component";
|
|
import { computed } from "@ember/object";
|
|
import { isEmpty } from "@ember/utils";
|
|
|
|
export default class Bool extends Component {
|
|
@computed("value")
|
|
get enabled() {
|
|
if (isEmpty(this.value)) {
|
|
return false;
|
|
}
|
|
return this.value.toString() === "true";
|
|
}
|
|
|
|
set enabled(value) {
|
|
this.set("value", value ? "true" : "false");
|
|
}
|
|
}
|