discourse/app/assets/javascripts/admin/components/staff-actions.js

Failed to ignore revisions in .git-blame-ignore-revs.

28 lines
625 B
JavaScript
Raw Normal View History

import Component from "@ember/component";
2018-06-15 23:03:24 +08:00
import DiscourseURL from "discourse/lib/url";
export default Component.extend({
2018-06-15 23:03:24 +08:00
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;
}
);
}
});