discourse/app/assets/javascripts/admin/addon/routes/admin-email-templates-edit.js
Kelv 1e0d773b54
DEV: duplicate scroll-top util function to lib and replace current usage with new path (#32367)
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.
2025-04-21 08:12:51 +08:00

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);
}
}