2021-12-09 20:47:56 +08:00
|
|
|
import { action } from "@ember/object";
|
2019-10-24 01:06:54 +08:00
|
|
|
import Controller from "@ember/controller";
|
2019-11-08 05:38:28 +08:00
|
|
|
import discourseComputed from "discourse-common/utils/decorators";
|
2019-04-26 18:16:21 +08:00
|
|
|
|
2019-10-24 01:06:54 +08:00
|
|
|
export default Controller.extend({
|
2019-11-08 05:38:28 +08:00
|
|
|
@discourseComputed
|
2021-11-13 21:01:55 +08:00
|
|
|
adminRoutes() {
|
2019-05-27 16:15:39 +08:00
|
|
|
return this.model
|
2017-02-10 01:11:53 +08:00
|
|
|
.map((p) => {
|
|
|
|
if (p.get("enabled")) {
|
|
|
|
return p.admin_route;
|
2016-10-21 01:26:41 +08:00
|
|
|
}
|
2017-02-10 01:11:53 +08:00
|
|
|
})
|
|
|
|
.compact();
|
2019-04-26 18:16:21 +08:00
|
|
|
},
|
|
|
|
|
2021-12-09 20:47:56 +08:00
|
|
|
@action
|
|
|
|
toggleMenu() {
|
|
|
|
const adminDetail = document.querySelector(".admin-detail");
|
|
|
|
["mobile-closed", "mobile-open"].forEach((state) => {
|
|
|
|
adminDetail.classList.toggle(state);
|
|
|
|
});
|
2018-07-03 11:14:53 +08:00
|
|
|
},
|
2015-02-07 06:32:59 +08:00
|
|
|
});
|