mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-25 20:15:50 +08:00
This was refactored from an actual Mixin some time back. This PR moves the function to the lib folder and keeps the same logic/interface otherwise. We'll remove the mixin file once all non-core repos change to use the new file.
18 lines
483 B
JavaScript
Vendored
18 lines
483 B
JavaScript
Vendored
import Route from "@ember/routing/route";
|
|
import { scrollTop } from "discourse/lib/scroll-top";
|
|
|
|
export default class AdminEmailTemplatesEditRoute extends Route {
|
|
model(params) {
|
|
const all = this.modelFor("adminEmailTemplates");
|
|
return all.findBy("id", params.id);
|
|
}
|
|
|
|
setupController(controller, emailTemplate) {
|
|
controller.setProperties({ emailTemplate, saved: false });
|
|
scrollTop();
|
|
}
|
|
|
|
deactivate() {
|
|
this.controller.set("emailTemplate", null);
|
|
}
|
|
}
|