DEV: drops jquery usage from discovery-categories (#15243)
This commit is contained in:
parent
df3886d6e5
commit
76dff7fd9e
|
@ -1,19 +1,20 @@
|
||||||
import Component from "@ember/component";
|
import Component from "@ember/component";
|
||||||
import UrlRefresh from "discourse/mixins/url-refresh";
|
import UrlRefresh from "discourse/mixins/url-refresh";
|
||||||
import { on } from "discourse-common/utils/decorators";
|
|
||||||
|
|
||||||
const CATEGORIES_LIST_BODY_CLASS = "categories-list";
|
const CATEGORIES_LIST_BODY_CLASS = "categories-list";
|
||||||
|
|
||||||
export default Component.extend(UrlRefresh, {
|
export default Component.extend(UrlRefresh, {
|
||||||
classNames: ["contents"],
|
classNames: ["contents"],
|
||||||
|
|
||||||
@on("didInsertElement")
|
didInsertElement() {
|
||||||
addBodyClass() {
|
this._super(...arguments);
|
||||||
$("body").addClass(CATEGORIES_LIST_BODY_CLASS);
|
|
||||||
|
document.body.classList.add(CATEGORIES_LIST_BODY_CLASS);
|
||||||
},
|
},
|
||||||
|
|
||||||
@on("willDestroyElement")
|
willDestroyElement() {
|
||||||
removeBodyClass() {
|
this._super(...arguments);
|
||||||
$("body").removeClass(CATEGORIES_LIST_BODY_CLASS);
|
|
||||||
|
document.body.classList.remove(CATEGORIES_LIST_BODY_CLASS);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue