discourse/app/assets/javascripts/admin/components/staff-actions.js.es6
Joffrey JAFFEUX b3eb67976d
DEV: Upgrades to Ember 3.10 (#7871)
Co-Authored-By: majakomel <maja.komel@gmail.com>
2019-07-16 12:45:15 +02:00

27 lines
589 B
JavaScript

import DiscourseURL from "discourse/lib/url";
export default Ember.Component.extend({
classNames: ["table", "staff-actions"],
willDestroyElement() {
$(this.element).off("click.discourse-staff-logs");
},
didInsertElement() {
this._super(...arguments);
$(this.element).on(
"click.discourse-staff-logs",
"[data-link-post-id]",
e => {
let postId = $(e.target).attr("data-link-post-id");
this.store.find("post", postId).then(p => {
DiscourseURL.routeTo(p.get("url"));
});
return false;
}
);
}
});