mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Rename .js.es6 to .js in the admin application
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
import { debounce } from "@ember/runloop";
|
||||
import Controller from "@ember/controller";
|
||||
let lastSearch;
|
||||
|
||||
export default Controller.extend({
|
||||
searching: false,
|
||||
siteTexts: null,
|
||||
preferred: false,
|
||||
queryParams: ["q", "overridden"],
|
||||
|
||||
q: null,
|
||||
overridden: false,
|
||||
|
||||
_performSearch() {
|
||||
this.store
|
||||
.find("site-text", this.getProperties("q", "overridden"))
|
||||
.then(results => {
|
||||
this.set("siteTexts", results);
|
||||
})
|
||||
.finally(() => this.set("searching", false));
|
||||
},
|
||||
|
||||
actions: {
|
||||
edit(siteText) {
|
||||
this.transitionToRoute("adminSiteText.edit", siteText.get("id"));
|
||||
},
|
||||
|
||||
toggleOverridden() {
|
||||
this.toggleProperty("overridden");
|
||||
this.set("searching", true);
|
||||
debounce(this, this._performSearch, 400);
|
||||
},
|
||||
|
||||
search() {
|
||||
const q = this.q;
|
||||
if (q !== lastSearch) {
|
||||
this.set("searching", true);
|
||||
debounce(this, this._performSearch, 400);
|
||||
lastSearch = q;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user