This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/admin/components/staff-actions.js.es6
2019-01-19 10:05:51 +01:00

23 lines
539 B
JavaScript

import DiscourseURL from "discourse/lib/url";
export default Ember.Component.extend({
classNames: ["table", "staff-actions"],
willDestroyElement() {
this.$().off("click.discourse-staff-logs");
},
didInsertElement() {
this._super(...arguments);
this.$().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;
});
}
});