mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 23:48:45 +08:00
b3eb67976d
Co-Authored-By: majakomel <maja.komel@gmail.com>
27 lines
589 B
JavaScript
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;
|
|
}
|
|
);
|
|
}
|
|
});
|