mirror of
https://github.com/discourse/discourse.git
synced 2025-04-19 03:09:05 +08:00
FIX: Follow open in new tab site setting for bio links (#11418)
This commit is contained in:
parent
5ab6ef9765
commit
812d047c60
@ -0,0 +1,23 @@
|
||||
import {
|
||||
openLinkInNewTab,
|
||||
shouldOpenInNewTab,
|
||||
} from "discourse/lib/click-track";
|
||||
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") {
|
||||
if (shouldOpenInNewTab(event.target.href)) {
|
||||
openLinkInNewTab(event.target);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
this._super(...arguments);
|
||||
$(this.element).off("click.discourse-open-tab", "a");
|
||||
},
|
||||
});
|
@ -0,0 +1 @@
|
||||
{{yield}}
|
@ -142,7 +142,11 @@
|
||||
</div>
|
||||
{{else}}
|
||||
{{#if this.user.bio_excerpt}}
|
||||
<div class="bio">{{html-safe this.user.bio_excerpt}}</div>
|
||||
<div class="bio">
|
||||
{{#html-with-links}}
|
||||
{{html-safe this.user.bio_excerpt}}
|
||||
{{/html-with-links}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
|
@ -144,7 +144,9 @@
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if isNotSuspendedOrIsStaff}}
|
||||
{{html-safe model.bio_cooked}}
|
||||
{{#html-with-links}}
|
||||
{{html-safe model.bio_cooked}}
|
||||
{{/html-with-links}}
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user