16 lines
337 B
JavaScript
16 lines
337 B
JavaScript
import {
|
|
openLinkInNewTab,
|
|
shouldOpenInNewTab,
|
|
} from "discourse/lib/click-track";
|
|
import Component from "@ember/component";
|
|
|
|
export default Component.extend({
|
|
click(event) {
|
|
if (event?.target?.tagName === "A") {
|
|
if (shouldOpenInNewTab(event.target.href)) {
|
|
openLinkInNewTab(event.target);
|
|
}
|
|
}
|
|
},
|
|
});
|