diff --git a/app/assets/javascripts/admin/addon/controllers/admin-plugins.js b/app/assets/javascripts/admin/addon/controllers/admin-plugins.js index 54551537da8..be663cadb15 100644 --- a/app/assets/javascripts/admin/addon/controllers/admin-plugins.js +++ b/app/assets/javascripts/admin/addon/controllers/admin-plugins.js @@ -1,3 +1,4 @@ +import { action } from "@ember/object"; import Controller from "@ember/controller"; import discourseComputed from "discourse-common/utils/decorators"; @@ -13,13 +14,11 @@ export default Controller.extend({ .compact(); }, - actions: { - clearFilter() { - this.setProperties({ filter: "", onlyOverridden: false }); - }, - - toggleMenu() { - $(".admin-detail").toggleClass("mobile-closed mobile-open"); - }, + @action + toggleMenu() { + const adminDetail = document.querySelector(".admin-detail"); + ["mobile-closed", "mobile-open"].forEach((state) => { + adminDetail.classList.toggle(state); + }); }, }); diff --git a/app/assets/javascripts/admin/addon/controllers/admin-site-settings.js b/app/assets/javascripts/admin/addon/controllers/admin-site-settings.js index 58859ae9335..dc5ba1193d7 100644 --- a/app/assets/javascripts/admin/addon/controllers/admin-site-settings.js +++ b/app/assets/javascripts/admin/addon/controllers/admin-site-settings.js @@ -5,6 +5,7 @@ import { alias } from "@ember/object/computed"; import discourseDebounce from "discourse-common/lib/debounce"; import { isEmpty } from "@ember/utils"; import { observes } from "discourse-common/utils/decorators"; +import { action } from "@ember/object"; export default Controller.extend({ filter: null, @@ -126,13 +127,16 @@ export default Controller.extend({ ); }, - actions: { - clearFilter() { - this.setProperties({ filter: "", onlyOverridden: false }); - }, + @action + clearFilter() { + this.setProperties({ filter: "", onlyOverridden: false }); + }, - toggleMenu() { - $(".admin-detail").toggleClass("mobile-closed mobile-open"); - }, + @action + toggleMenu() { + const adminDetail = document.querySelector(".admin-detail"); + ["mobile-closed", "mobile-open"].forEach((state) => { + adminDetail.classList.toggle(state); + }); }, }); diff --git a/app/assets/javascripts/admin/addon/templates/plugins.hbs b/app/assets/javascripts/admin/addon/templates/plugins.hbs index 9dad110efc4..054a6d10068 100644 --- a/app/assets/javascripts/admin/addon/templates/plugins.hbs +++ b/app/assets/javascripts/admin/addon/templates/plugins.hbs @@ -26,5 +26,3 @@