DEV: refactors admin-plugins/admin-site-settings (#15244)
- drops jQuery usage - removes apparently useless clearfix - uses @action - drops unused clearFilter function in admin-plugins
This commit is contained in:
parent
5d44adb9b9
commit
f889ec2fcd
|
@ -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);
|
||||
});
|
||||
},
|
||||
});
|
||||
|
|
|
@ -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);
|
||||
});
|
||||
},
|
||||
});
|
||||
|
|
|
@ -26,5 +26,3 @@
|
|||
<div class="admin-detail pull-left mobile-closed">
|
||||
{{outlet}}
|
||||
</div>
|
||||
|
||||
<div class="clearfix"></div>
|
||||
|
|
Loading…
Reference in New Issue