DEV: Remove computed field
There was a lot of code for very little functionality and it caused issues with other plugin tests.
This commit is contained in:
parent
47ae7d38d5
commit
0d4f38404b
|
@ -1,5 +1,3 @@
|
||||||
import { computed } from "@ember/object";
|
|
||||||
import Category from "discourse/models/category";
|
|
||||||
import { withPluginApi } from "discourse/lib/plugin-api";
|
import { withPluginApi } from "discourse/lib/plugin-api";
|
||||||
|
|
||||||
function initialize(api) {
|
function initialize(api) {
|
||||||
|
@ -46,17 +44,5 @@ export default {
|
||||||
initialize() {
|
initialize() {
|
||||||
withPluginApi("0.8.4", api => initialize(api));
|
withPluginApi("0.8.4", api => initialize(api));
|
||||||
withPluginApi("0.8.30", api => api.addCategorySortCriteria("votes"));
|
withPluginApi("0.8.30", api => api.addCategorySortCriteria("votes"));
|
||||||
|
|
||||||
Category.reopen({
|
|
||||||
enable_topic_voting: computed("custom_fields.enable_topic_voting", {
|
|
||||||
get(enableField) {
|
|
||||||
return enableField;
|
|
||||||
},
|
|
||||||
set(value) {
|
|
||||||
this.set("custom_fields.enable_topic_voting", value);
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<section class='field'>
|
<section class='field'>
|
||||||
<div class="enable-topic-voting">
|
<div class="enable-topic-voting">
|
||||||
<label class="checkbox-label">
|
<label class="checkbox-label">
|
||||||
{{input type="checkbox" checked=category.enable_topic_voting}}
|
{{input type="checkbox" checked=category.custom_fields.enable_topic_voting}}
|
||||||
{{i18n 'voting.allow_topic_voting'}}
|
{{i18n 'voting.allow_topic_voting'}}
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue