mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 00:43:24 +08:00
f889ec2fcd
- drops jQuery usage - removes apparently useless clearfix - uses @action - drops unused clearFilter function in admin-plugins
25 lines
585 B
JavaScript
25 lines
585 B
JavaScript
import { action } from "@ember/object";
|
|
import Controller from "@ember/controller";
|
|
import discourseComputed from "discourse-common/utils/decorators";
|
|
|
|
export default Controller.extend({
|
|
@discourseComputed
|
|
adminRoutes() {
|
|
return this.model
|
|
.map((p) => {
|
|
if (p.get("enabled")) {
|
|
return p.admin_route;
|
|
}
|
|
})
|
|
.compact();
|
|
},
|
|
|
|
@action
|
|
toggleMenu() {
|
|
const adminDetail = document.querySelector(".admin-detail");
|
|
["mobile-closed", "mobile-open"].forEach((state) => {
|
|
adminDetail.classList.toggle(state);
|
|
});
|
|
},
|
|
});
|