From 76dff7fd9e2aceeed1c01c7e807f458ac5e1ed80 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Thu, 9 Dec 2021 13:47:13 +0100 Subject: [PATCH] DEV: drops jquery usage from discovery-categories (#15243) --- .../app/components/discovery-categories.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/discourse/app/components/discovery-categories.js b/app/assets/javascripts/discourse/app/components/discovery-categories.js index 4be34e7e4f..3843a4366e 100644 --- a/app/assets/javascripts/discourse/app/components/discovery-categories.js +++ b/app/assets/javascripts/discourse/app/components/discovery-categories.js @@ -1,19 +1,20 @@ import Component from "@ember/component"; import UrlRefresh from "discourse/mixins/url-refresh"; -import { on } from "discourse-common/utils/decorators"; const CATEGORIES_LIST_BODY_CLASS = "categories-list"; export default Component.extend(UrlRefresh, { classNames: ["contents"], - @on("didInsertElement") - addBodyClass() { - $("body").addClass(CATEGORIES_LIST_BODY_CLASS); + didInsertElement() { + this._super(...arguments); + + document.body.classList.add(CATEGORIES_LIST_BODY_CLASS); }, - @on("willDestroyElement") - removeBodyClass() { - $("body").removeClass(CATEGORIES_LIST_BODY_CLASS); + willDestroyElement() { + this._super(...arguments); + + document.body.classList.remove(CATEGORIES_LIST_BODY_CLASS); }, });