mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 05:33:37 +08:00
DEV: removes jquery usage from html-with-links (#14966)
This commit is contained in:
parent
32c6c4f417
commit
f9682f1c69
|
@ -5,19 +5,11 @@ import {
|
|||
import Component from "@ember/component";
|
||||
|
||||
export default Component.extend({
|
||||
didInsertElement() {
|
||||
this._super(...arguments);
|
||||
$(this.element).on("click.discourse-open-tab", "a", (event) => {
|
||||
if (event.target && event.target.tagName === "A") {
|
||||
click(event) {
|
||||
if (event?.target?.tagName === "A") {
|
||||
if (shouldOpenInNewTab(event.target.href)) {
|
||||
openLinkInNewTab(event.target);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
this._super(...arguments);
|
||||
$(this.element).off("click.discourse-open-tab", "a");
|
||||
},
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user