DEV: Update modifyClass calls to native class syntax (#656)
This commit is contained in:
parent
6f682acae3
commit
b8d50e9675
|
|
@ -5,24 +5,27 @@ export default {
|
||||||
name: "disable-sort",
|
name: "disable-sort",
|
||||||
initialize() {
|
initialize() {
|
||||||
withPluginApi("0.8", (api) => {
|
withPluginApi("0.8", (api) => {
|
||||||
api.modifyClass("component:topic-list", {
|
api.modifyClass(
|
||||||
pluginId: "discourse-calendar",
|
"component:topic-list",
|
||||||
|
(Superclass) =>
|
||||||
@discourseComputed(
|
class extends Superclass {
|
||||||
"category",
|
@discourseComputed(
|
||||||
"siteSettings.disable_resorting_on_categories_enabled"
|
"category",
|
||||||
)
|
"siteSettings.disable_resorting_on_categories_enabled"
|
||||||
sortable(category, disable_resorting_on_categories_enabled) {
|
)
|
||||||
let disableSort = false;
|
sortable(category, disable_resorting_on_categories_enabled) {
|
||||||
if (
|
let disableSort = false;
|
||||||
disable_resorting_on_categories_enabled &&
|
if (
|
||||||
category?.custom_fields
|
disable_resorting_on_categories_enabled &&
|
||||||
) {
|
category?.custom_fields
|
||||||
disableSort = !!category.custom_fields["disable_topic_resorting"];
|
) {
|
||||||
|
disableSort =
|
||||||
|
!!category.custom_fields["disable_topic_resorting"];
|
||||||
|
}
|
||||||
|
return !!this.changeSort && !disableSort;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return !!this.changeSort && !disableSort;
|
);
|
||||||
},
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue